Page 1 of 1

MouseCursorImage's click area

Posted: Tue May 25, 2010 12:15
by Excizted
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/

Re: MouseCursorImage's click area

Posted: Wed May 26, 2010 08:32
by CrazyEddie
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.

Re: MouseCursorImage's click area

Posted: Wed May 26, 2010 08:37
by Excizted
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 ;)

Re: MouseCursorImage's click area

Posted: Wed May 26, 2010 19:37
by CrazyEddie
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.