Skip to content

makeSprite

makeSprite(opt): GameObj<BaseComps & RenderComps & SpriteComp>

Make an object with a sprite component. Maker extends makeRender

Parameters

ParameterType
optObjOpt & RenderOpt & SpriteOpt

Returns

GameObj<BaseComps & RenderComps & SpriteComp>

Example

const sprite = k.add(k.makeSprite(\{
sprite: "bean", // from makeSprite
scale: 2, // from makeRender
pos: k.vec2(100, 100), // from makeObject
\}));
@group Object Makers
## Source
global.d.ts:9