how to adjust the characters offset point?

Started by Rocco, Fri 20/11/2009 17:37:39

Previous topic - Next topic

Rocco

i use a birdeye view.
So when i click some where on the screen, and the player walks to this point,
he doesnt stand in the right spot (allways to far above), cause the offset point is set to the feet of the characters (down-edge of sprite) per default.
how is it possible to change that point, within the character views?

the other problem based on this fact is, that the character moves way to far beyond walking areas

monkey0506

You can use the Character.z property to offset the character's image (along the Y-axis) while leaving the Y-coordinate in tact for registering events and things.

So for example:

Code: ags
player.z = (HEIGHT / 2); // HEIGHT is the height of the player's sprite


That would center the character's graphic around his (X,Y) instead of being centered around his feet.

SMF spam blocked by CleanTalk