Transform
class in OpalScript
This object's pose. Writes keep Motion targets in sync.
Properties
| Member | Description |
|---|---|
| Transform.Position | Local position in pixels. |
| Transform.WorldPosition | The sprite center in scene world coordinates, using the current visual pose. Physics offers separate SimulationPosition. |
| Transform.WorldPoint | Typed sprite origin in world coordinates. Local conversion points use this object's origin-local coordinates, not its parent's position space. |
| Transform.Rotation | Local rotation in degrees. |
Methods
| Member | Description |
|---|---|
| Transform.Move | Move by pixels; keeps Motion targets in sync. |
| Transform.Rotate | Rotate by degrees; keeps Motion targets in sync. |
| Transform.LocalToWorld | Convert an origin-local point (0,0 is the sprite center) through this object's visual transform to scene world coordinates. |
| Transform.WorldToLocal | Convert 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);
}