getting x and y of mouseclick on actor?

Non-platform specific questions.

getting x and y of mouseclick on actor?

Postby sonicfire » Thu Oct 06, 2011 3:44 pm

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).
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: getting x and y of mouseclick on actor?

Postby foleyjo » Thu Oct 06, 2011 3:51 pm

why not use 2 filled regions?
Use 1 for the top of the image and 1 for the bottom.
KISS -Keep It Simple Stoopid
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score

Re: getting x and y of mouseclick on actor?

Postby skydereign » Thu Oct 06, 2011 8:25 pm

You mean like this?
Code: Select all
if(xmouse>xscreen+width/2 && ymouse>yscreen+height/2) {};
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: getting x and y of mouseclick on actor?

Postby sonicfire » Thu Oct 06, 2011 8:44 pm

@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.
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest