Atlantis.Camera2D Class
A camera used in a 2D scene to manage scrolling
Constructor
Item Index
Methods
follow
(
-
sprite
Follow a sprite
Parameters:
-
sprite
Atlantis.SpriteA sprite to follow.
getRelativePosition
(
Object
-
sprite
Gets the relative position of a sprite relative to the camera position.
Parameters:
-
sprite
Atlantis.SpriteThe sprite to use.
Returns:
Object:
Return a structure with x and y coordinates.
getSpritePosition
()
Object
Gets the position of the sprite on screen relative to the camera position.
Returns:
Object:
Return a structure with x and y coordinates.
update
()
Update the camera position. If a sprite is attached to it, its position is managed by the camera.