Setting XOffset/YOffset at runtime... how?

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
synergy
Just popping in
Just popping in
Posts: 10
Joined: Mon Aug 01, 2005 17:15
Location: Toronto, Canada

Setting XOffset/YOffset at runtime... how?

Postby synergy » Fri Feb 17, 2006 21:54

Hey again,

I am busy working on my game's inventory system and have encountered a small (yet significant) roadblock.

I would assume that most people are familiar with standard RPG inventory system functionality. Our version is based on square item icons (32x32) and a one-item-per-inv-slot scheme. As usual, when you click on an item in your inventory, you "pick it up" and the mouse cursor image changes to reflect the in-hand item.

The problem arises when I swap the mouse cursor to the item icon. I want to use the centre of the item icon as the mouse cursor point (instead of the usual top-left corner). Upon some investigation, I noticed that the "target" mouse cursor in the TaharezLook imageset has XOffset and YOffset values to address this idea. I also know that the XOffset and YOffset are properties of an Image object (and are applied every time that particular Image is rendered) -- and this is precisely why the same solution has not worked for me.

Since I am using these item icons as more than a mouse cursor (i.e. the same image needs to rest in a backpack slot, etc.), I need to set the XOffset/YOffset when the item is picked up and re-set it when the item is put back down... but there are no such set methods!

What should I do? Any ideas?

Thanks in advance.

Ryan

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Sat Feb 18, 2006 02:10

You're right. This functionality is actually missing.

For now a workaround would be to delete/recreate the images, only changing the offset each time.

HTH


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 6 guests