SetCameraX

From Spheriki

Jump to: navigation, search

Sets the X position of the camera when the map engine is open and the camera isn't attached to a person.


Contents

Usage

function SetCameraX(xpos);
  • xpos The x position in pixels to set the camera to.


Examples

SetCameraX(10 * GetTileWidth());

Sets the camera's x to the 10th tile.

if (GetCameraX() <= 300) SetCameraX(GetCameraX() + 1);

When set as a render script or delay script, this scrolls the camera to the right until it reached the destination of 300 pixels.


Notes

Note that the camera's position is aligned in the center. When setting the camera's x to 500, it will CENTER the screen to x pixel 500.


See also

Personal tools