Actors > Position


Position

Get Position

x of actor

Gets the current [X / Y] position of the actor.

[ACTOR].getX()
[ACTOR].getY()
[ACTOR].getXCenter()
[ACTOR].getYCenter()
[ACTOR].getScreenX()
[ACTOR].getScreenY()

Set Position

set x to number for actor

Sets the [X, Y] position of the actor.

[ACTOR].setX([NUMBER]);
[ACTOR].setY([NUMBER]);
[ACTOR].setXCenter([NUMBER]);
[ACTOR].setYCenter([NUMBER]);
[ACTOR].setScreenX([NUMBER]);
[ACTOR].setScreenY([NUMBER]);

Actor is on screen?

actor is on screen

Returns true if the specified actor is at least partially on screen.

[ACTOR].isOnScreen()

Direction

Get Direction (Angle)

direction of actor

Returns the actor's direction (angle), in degrees. 0 degrees -> facing right. 90 degrees -> facing down.

(Utils.DEG * [ACTOR].getAngle())

Set Direction (Angle)

point actor towards number degrees

Sets the actor's direction (angle), in degrees. 0 degrees -> facing right. 90 degrees -> facing down.

[ACTOR].setAngle(Utils.RAD * [NUMBER]);

Turn Clockwise

turn actor by number degrees

Instantly rotates the the actor clockwise by the given number of degrees.

[ACTOR].rotate(Utils.RAD * [NUMBER]);

Turn Counter Clockwise

turn actor by number degrees

Instantly rotates the the actor counter-clockwise by the given number of degrees.

[ACTOR].rotate(-Utils.RAD * [NUMBER]);