Page 1 of 1

getting x and y of mouseclick on actor?

PostPosted: Thu Oct 06, 2011 3:44 pm
by sonicfire
i´m struggling with this currently.
i have an actor that is a button. now, when i click it i
want to check if the click is > or < (height/2) of actor.

any ideas? :)

EDIT: reason i´m asking is, i wanna "seperate" one button actor into two buttons. (but with one image).

Re: getting x and y of mouseclick on actor?

PostPosted: Thu Oct 06, 2011 3:51 pm
by foleyjo
why not use 2 filled regions?
Use 1 for the top of the image and 1 for the bottom.

Re: getting x and y of mouseclick on actor?

PostPosted: Thu Oct 06, 2011 8:25 pm
by skydereign
You mean like this?
Code: Select all
if(xmouse>xscreen+width/2 && ymouse>yscreen+height/2) {};

Re: getting x and y of mouseclick on actor?

PostPosted: Thu Oct 06, 2011 8:44 pm
by sonicfire
@foleyjo: i want to simplify it, that´s why i only want to use one actor :)

@sky: thanks, exactly what i did, works like a charm.