actor in screen area detection

applaudmobileapplaudmobile Member Posts: 208
edited November -1 in Working with GS (Mac)
Hi I've got a problem one of you bright sparks might have an idea about :)

The scene size (ipad) is 2 widths and 2 heights. There's an actor that whizzes around the whole scene using a multi-directional joystick. The camera tracks him

When movement stops I need to be able to work out if he is in the upper half or lower half of the visible screen!!

I've got the actor's X & Y and the camera's (which is the same) but can't work out how to do this.

Depending on what direction he is moving he could stop at Y position 768 which is half way up the double size scene but he could stop in any position on the visible scene.

Is there some trick out there to do this?

Edit : sorry, the camera X&Y are different to the actor of course but since the tracking area is 500x300 the camera.Y doesn't always reflect movement on the screen. I know, this confuses the question. But if anyone understand what I mean...... thx :)

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Camera Origin Values are actually based on the Left side position and bottom of the screen position.

    So lets say you actor stops at a y value of 768

    and the cameras y origin is 500

    The center of the screens position would be 500+384 which equals 884. so the actors position is less than the center making it in the lower half.

    Hope that helps.
  • applaudmobileapplaudmobile Member Posts: 208
    Thank you, thank you!

    That was so simple I'm ashamed I didn't work it out myself.
Sign In or Register to comment.