X and Y co-ordinates
markfirman
Member, BASIC Posts: 18
Hello all,
I'm wondering if there is any practical method to getting the X and Y co-ordinates of a scene. The co-ordinates I require must be extracted from an actor that spawns randomly from any location around the outside of the scene.
So for example if the actor spawns from the bottom left - the co-ordinates I require would be the top left. Equally, if the actor spawns top right, the co-ordinates I require would be bottom right.
Is there a formula or better method of achieving this than planting a heck load of rules to check entry points ect...?
Thanks
Mark
Comments
could you use something like
require_x = actor_x
require_y = midY + (midY - actor_y)
where midY is middle of y position of your screen.
so that if your screen is 500 height and 300 width,
and if your actor is spawned at (0,0) (bottom left)
you'd get (0,500) (top left) for required coordinates
if your actor spawned at (300, 500) (top right)
you'd get (300,0) (bottom right)