A box that can be rendered on screen.
new Box(scene, config);
scene—SceneThe scene this Object is a part of.config—ObjectTheBox's config object.config.x—numberThisBoxobject's x-coordinate.config.y—numberThisBoxobject's y-coordinate.config.width—numberThisBoxobject's width.config.height—numberThisBoxobject's height.config.color—stringOptional Box color.config.backgroundColor—stringOptional background color.config.style—stringThe box line style."line" || "double"
Get the rounded width of the box.
Set the width of the box.
n—numberThe new width of the box.
ErrorIf the width value is not of type 'number'.
Get the rounded height of the box.
Set the height of the box.
n—numberThe new height of the box.
ErrorIf the height value is not of type 'number'.
Generate the renderable representation of the box.
PixelMeshThe PixelMesh representation of the box based on its dimensions, color, and style.
Get just the renderable PixelMesh portion of a Box instance.
width—numberThisBoxobject's width.height—numberThisBoxobject's height.color—stringOption Box color.backgroundColor—stringOptional background color.style—stringThe box line style."line" || "double"
The generated PixelMesh.
const myGameObject = new GameObject(scene, 0, 0, "system");
myGameObject.renderable = Box.asPixelMesh(
width,
height,
color,
backgroundColor,
style
);