Create both local and world transform components. World transform is initialized to match local transform.
The x coordinate
The y coordinate
Optional
Optional rotation and scale
Component object suitable for spreading into spawn()
ecs.spawn({ ...createTransform(100, 200), sprite,});// With rotation and scaleecs.spawn({ ...createTransform(100, 200, { rotation: Math.PI / 4, scale: 2 }), sprite,}); Copy
ecs.spawn({ ...createTransform(100, 200), sprite,});// With rotation and scaleecs.spawn({ ...createTransform(100, 200, { rotation: Math.PI / 4, scale: 2 }), sprite,});
Create both local and world transform components. World transform is initialized to match local transform.