MouseCursorImage's click area

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

Excizted
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Tue Feb 23, 2010 22:16

MouseCursorImage's click area

Postby Excizted » Tue May 25, 2010 12:15

Hello,

Based on the ThararezLook I've created my own GUI sheet which works perfectly.
I've run into a bump though. I've got a MouseCursorImage on my editable boxes, that looks like the windows one.

It has those horizontal lines which gives it a larger width. So when I click in my editbox, the text carat moves to where the left corner of my mousecursorimage is rather than the middle of the mousecursorimage, which is the windows-style.

I tried messing with properties, but without success.

What to do, what to do? :)

Image that shows the mousecursor style: http://img171.imageshack.us/i/ceguiissue.jpg/

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: MouseCursorImage's click area

Postby CrazyEddie » Wed May 26, 2010 08:32

The way to do this is to specify an offset for the image in the imageset. This offset shifts the image so that the 'hot-spot' for the mouse appears at the correct location. For instance if the horizontal centre point is 10 pixels in, you specify an XOffset attribute of -10 (the negative is important since you're shifting the image not the hot spot), and also do a similar thing for YOffset.

So, taken from TaharezLook, we have this:

Code: Select all

<Image Name="MouseMoveCursor" XPos="201" YPos="127" Width="18" Height="18" XOffset="-8" YOffset="-8" />


HTH

CE.

Excizted
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Tue Feb 23, 2010 22:16

Re: MouseCursorImage's click area

Postby Excizted » Wed May 26, 2010 08:37

Thank you so much, that was simple :)
And good job on understanding the question, I just re-read it, I don't think I was very clear ;)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: MouseCursorImage's click area

Postby CrazyEddie » Wed May 26, 2010 19:37

Excizted wrote:good job on understanding the question, I just re-read it, I don't think I was very clear ;)

Thanks, I've had a fair amount of practice at deciphering the content of people's posts ;)

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 12 guests