DrawableText
Extends: Drawable
Class to draw text
Properties
text(string) — The text to write on the screenfont(roFont) — The Font object to use ( get this from the font registry)alignment(BGE.UI.HorizAlignment) — The Horizontal alignment for the texttextColor(integer) — The color the text is drawn inlastTextValue(string)lastTextColor(integer)tempCanvas(roBitmap)tempRegion(roRegion)lastAlignment(BGE.UI.HorizAlignment)
Constructor
new DrawableText(
owner: GameEntity,
text?: string,
font?: roFont,
args?: roAssociativeArray,
): DrawableTextParameters
owner(GameEntity)text(string, optional, default: "\"\"")font(roFont, optional, default: "invalid")args(roAssociativeArray, optional, default: "{}")
Instance Methods
addToScene(rendererObj: Renderer): BGE.SceneObject
Parameters
rendererObj(Renderer)
Returns
getTextImage(): roRegion
Returns
roRegion
update(): void
alignment is a plain public field, so a direct assignment can't be intercepted - this dirty-checks it each frame and syncs it into the unified anchor mechanism (see Drawable.setAnchor), the same idiom this codebase uses for Camera3d.fieldOfViewDegrees.
Returns
void