Skip to content

makeRect

makeRect(opt): GameObj<BaseComps & RenderComps & RectComp>

Make an object with a rectangle component. Maker extends makeRender

Parameters

ParameterType
optObjOpt & RenderOpt & RectOpt

Returns

GameObj<BaseComps & RenderComps & RectComp>

Example

const rect = k.add(k.makeRect({
size: k.vec2(50, 50) // from makeRect
color: "#ff00ff", // from makeRender
}));

Source

global.d.ts:6