Skip to content

Transform ​

class in OpalScript

This object's pose. Writes keep Motion targets in sync.

Properties ​

MemberDescription
Transform.PositionLocal position in pixels.
Transform.WorldPositionThe sprite center in scene world coordinates, using the current visual pose. Physics offers separate SimulationPosition.
Transform.WorldPointTyped sprite origin in world coordinates. Local conversion points use this object's origin-local coordinates, not its parent's position space.
Transform.RotationLocal rotation in degrees.

Methods ​

MemberDescription
Transform.MoveMove by pixels; keeps Motion targets in sync.
Transform.RotateRotate by degrees; keeps Motion targets in sync.
Transform.LocalToWorldConvert an origin-local point (0,0 is the sprite center) through this object's visual transform to scene world coordinates.
Transform.WorldToLocalConvert a scene world point into this object's origin-local coordinates, including parent transforms and pivot.

Example ​

csharp
void Update(float dt) {
    Transform.Move(60 * dt, 0);
}

See also ​