Draw text on main canvas in world space * Automatically splits new lines into rows * @param {string|number} text * @param {Vector2} pos * @param {number} [size] * @param {Color} [color=WHITE] * @param {number} [lineWidth] * @param {Color} [lineColor=BLACK] * @param {CanvasText
(text, pos, size=1, color=WHITE, lineWidth=0, lineColor=BLACK, textAlign='center', font=fontDefault, fontStyle='', maxWidth, angle=0, context=drawContext)
| 887 | * @param {CanvasRenderingContext2D|OffscreenCanvasRenderingContext2D} [context=drawContext] |
| 888 | * @memberof Draw */ |
| 889 | function drawText(text, pos, size=1, color=WHITE, lineWidth=0, lineColor=BLACK, textAlign='center', font=fontDefault, fontStyle='', maxWidth, angle=0, context=drawContext) |
| 890 | { |
| 891 | // convert to screen space |
| 892 | pos = worldToScreen(pos); |
| 893 | size *= cameraScale; |
| 894 | lineWidth *= cameraScale; |
| 895 | angle -= cameraAngle; |
| 896 | angle *= -1; |
| 897 | |
| 898 | drawTextScreen(text, pos, size, color, lineWidth, lineColor, textAlign, font, fontStyle, maxWidth, angle, context); |
| 899 | } |
| 900 | |
| 901 | /** Draw text in screen space |
| 902 | * Automatically splits new lines into rows |
nothing calls this directly
no test coverage detected