The 2D layer · interface
SpritePlacement
Where a sprite goes, in whatever space the batch is being drawn in.
Explained in Sprites and tilemaps.
interface SpritePlacementimport type { SpritePlacement } from '@driftengine/ui2d';Properties
| Name | Type | Description |
|---|---|---|
xreadonly | number | The corner the sprite grows from, and which corner depends on the affine.MoreIn screen space y counts down, so this is the top-left; in a 2D world y counts up, so it is
the bottom-left. The batch does not know which it is in and does not need to: it is the same
arithmetic either way, and |
yreadonly | number | |
wreadonly | number | |
hreadonly | number | |
rotationreadonlyoptional | number | Radians, anticlockwise in the mathematical sense — which reads as clockwise on screen, where y counts down. Defaults to none. |
pivotXreadonlyoptional | number | The point rotation turns about, as a fraction of the sprite. Defaults to its centre. |
pivotYreadonlyoptional | number |