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())
| 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 |