How to detect if the mouse is in a specific boundary of an actor?

carlblanchetcarlblanchet Member Posts: 755
edited October 2012 in Working with GS (Mac)
So I'm trying to make it that the 100x100 sized actor can detect a mouse inside only if the mouse is in the 60x100 section of the actor.

How could this be done?

Thanks for your time! :)

Best Answer

  • tenrdrmertenrdrmer Posts: 9,934
    Accepted Answer
    and while those positions change the rule will re fire and recheck every time it changes. you have access to every actors x and y position as an attribute in each actor. you have to use the expression editor and place those attributes in the expressions and thats how you calculate based on the changing positions.

    In the future please do not be so quick to reject a perfectly legitimate answer because you don't see how it could work. just come back tag the person and ask for more info. They are far more likely to keep helping you when you don't just tell them they are wrong.

    Cheers

Answers

  • hotMagichotMagic Member, PRO Posts: 266
    You basically just make a rule that says, if mouse is inside, compare the mouse x,y to the position x,y of the actor.

    For example, if mouse x actor x-30
    and the same for mouse y. That would check to make sure it's within a box area of 60x60 in the center of the actor.

  • carlblanchetcarlblanchet Member Posts: 755
    edited October 2012
    I can't calculate the actor's x and y position with this because the actor move up, down, and rotates..
  • carlblanchetcarlblanchet Member Posts: 755
    @tenrdrmer Copy that!

    Thanks for the extra help!
Sign In or Register to comment.