Create a tile slice style
tileInfo TileInfoThe tile, or the first of the tiles, to draw with
slices number optional, default 99 for a nine-slice, 3 for a three-slice, 1 for the whole tile
borderSize number optionalDrawn thickness of the edges and corners, undefined for the draw's own default
extraSpace number optionalExtra spacing adjustment of the slices, undefined for the draw's own default
const panel = new TileSlice(tile(0, 16), 9, .5); // a border of half a world unit
panel.draw(vec2(0, 5), vec2(10, 4));
uiSystem.defaultSlice = new TileSlice(tile(0, 16), 9, 16); // UI sizes are pixels, every widget made after this
Drawn thickness of the edges and corners, undefined for the draw's default
9 for a nine-slice, 3 for a three-slice, 1 for the whole tile
The tile, or the first of the tiles, to draw with
Draw it as a box in world space, or in screen space
pos Vector2Center position
size Vector2Size of the box
color Color optionalColor to modulate with
additiveColor Color optionalAdditive color
angle number optional, default 0Angle to rotate by
useWebGL boolean optional, default glEnableUse WebGL for rendering
screenSpace boolean optional, default drawScreenSpaceAre pos and size in screen space?
context CanvasRenderingContext2D|OffscreenCanvasRenderingContext2D optionalCanvas context to use
Draw it as a box in screen space, with the 2D context by default, on top of what WebGL drew, like drawTextScreen
pos Vector2Screen space center position
size Vector2Screen space size
color Color optionalColor to modulate with
additiveColor Color optionalAdditive color
angle number optional, default 0Angle to rotate by
useWebGL boolean optional, default falseUse WebGL for rendering
context CanvasRenderingContext2D|OffscreenCanvasRenderingContext2D optionalCanvas context to use