Making a crosshair mouse cursor

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

jadam
Just popping in
Just popping in
Posts: 9
Joined: Tue Sep 11, 2012 11:00

Making a crosshair mouse cursor

Postby jadam » Fri Jan 04, 2013 08:28

Hi,

I've successfully created my imageset with a crosshair shaped mouse cursor, but I can't figure out how can I make CEGUI consider the center if the image as the actual mouse cursor position.

I use CEGUI with Ogre and OIS, and I was messing around with trying to offset the mouse position, but I understood that injectMouseMove and such will not do any good to me.

Is there a way making the crosshair's center as the actucal mouse position?

Thanks,
Adam.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Making a crosshair mouse cursor

Postby Kulik » Fri Jan 04, 2013 09:22

Look into offset attribute of each <Image> in the imageset. You can change what CEGUI will treat as the 0, 0 point of the image.

We even have images that do this, resizing cursors and such come to mind.

jadam
Just popping in
Just popping in
Posts: 9
Joined: Tue Sep 11, 2012 11:00

Re: Making a crosshair mouse cursor

Postby jadam » Fri Jan 04, 2013 13:15

Thanks a lot!

Got it working, though I've found out that CEED does not generate the correct XML, as it generates "yOffset = ..." and "xOffset = ..." while apparently it needs to be "XOffset = ..." and "YOffset = ..." for the CEGUI library to take it into consideration.

Anyway, thanks, that solved my problem!

Adam.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 24 guests