Examples
import { World } from '@wimaengine/ecs'
import { createTransform2D } from '@wimaengine/transform'
const world = new World()
world.spawn(createTransform2D(10, 20, Math.PI / 4))Function
createTransform2D(dx?: number, dy?: number, a?: number, sx?: number, sy?: number): [Position2D, Orientation2D, Scale2D, GlobalTransform2D]Creates the standard 2D transform component bundle for an entity.
The returned tuple contains Position2D, Orientation2D,
Scale2D, and GlobalTransform2D in insertion order.
Position defaults to (0, 0), the angle defaults to 0, and scale defaults
to (1, 1). The angle is converted to the cosine/sine representation used
by Orientation2D.
import { World } from '@wimaengine/ecs'
import { createTransform2D } from '@wimaengine/transform'
const world = new World()
world.spawn(createTransform2D(10, 20, Math.PI / 4))