MCPcopy
hub / github.com/KilledByAPixel/LittleJS / drawTile

Method drawTile

plugins/uiSystem.js:394–408  ·  view source on GitHub ↗

Draw a tile to the UI context * @param {Vector2} pos * @param {Vector2} size * @param {TileInfo} tileInfo * @param {Color} [color=uiSystem.defaultColor] * @param {number} [angle] * @param {boolean} [mirror] * @param {Color} [shadowColor] * @param {n

(pos, size, tileInfo, color=uiSystem.defaultColor, angle=0, mirror=false, shadowColor=BLACK, shadowBlur=0, shadowOffset=vec2())

Source from the content-addressed store, hash-verified

392 * @param {number} [shadowBlur]
393 * @param {Color} [shadowOffset] */
394 drawTile(pos, size, tileInfo, color=uiSystem.defaultColor, angle=0, mirror=false, shadowColor=BLACK, shadowBlur=0, shadowOffset=vec2())
395 {
396 const context = uiSystem.uiContext;
397 if (shadowBlur || shadowOffset.x || shadowOffset.y)
398 if (shadowColor.a > 0)
399 {
400 // setup shadow
401 context.shadowColor = shadowColor.toString();
402 context.shadowBlur = shadowBlur;
403 context.shadowOffsetX = shadowOffset.x;
404 context.shadowOffsetY = shadowOffset.y;
405 }
406 drawTile(pos, size, tileInfo, color, angle, mirror, CLEAR_BLACK, false, true, context);
407 context.shadowColor = '#0000';
408 }
409
410 /** Draw text to the UI context
411 * @param {string} text

Callers 1

renderMethod · 0.45

Calls 3

vec2Function · 0.85
drawTileFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected