ChangeRoomAutoPosition question

Started by dbuske, Mon 07/03/2011 15:15:47

Previous topic - Next topic

dbuske

From the editor help:

"Altenatively, you can specify the position where he will get placed in the new room. newPosition can be 1000 for the left edge, 2000 for the right edge, 3000 for the bottom edge and 4000 for the top edge. Then, add on the offset within that edge where you want to place the character, in normal room co-ordinates.
Example:

player.ChangeRoomAutoPosition(4, 2100);"

My question is the help doesn't show how to write the offset from the edge. Is it?
player.ChangeRoomAutoPosition(4, 2100, 567, 789);
What if your blessings come through raindrops
What if your healing comes through tears...

Khris

Why would you need a separate command at all if you had to specify the coordinates anyway...?

As far as I understand this, if you want to put the character on the left edge, 100 pixels from the top of the screen, you'd use
Code: ags
  player.ChangeRoomAutoPosition(room, 1100);      1000 (left edge) + 100


If you want to put them at x = 400, y = bottom_edge, use
Code: ags
  player.ChangeRoomAutoPosition(room, 3400);    3000 (bottom edge) + 400


dbuske

Thanks it worked.  I just added +400 into the (    ).
What if your blessings come through raindrops
What if your healing comes through tears...

SMF spam blocked by CleanTalk