BitmapTextElement
The BitmapTextElement uses and displays a specified bitmap text. It is intended for single line text only and automatically aligns vertically based on the height center for the container.
JLS.core.BitmapTextElement
new BitmapTextElement(options)
// Implementation example
import { BitmapTextElement } from 'path/to/elements'
const bmpText = new BitmapTextElement({
origin: { ref: 'bmptext', x: 0, y: 0, w: 40, h: 15 },
offsetTextX : 0,
offsetTextY : 0,
initialValue : 0,
fontColor : 'FFFFFF',
fontSize : 26,
tint : 'FFFFFF',
border : { size: 2, tint: 'FFFFFF', radius: 5 },
bitmapText : '15px Anale',
triggers : [],
forceAlignRight : false,
forceVerticalCenter : true,
forceHorizontalCenter : false,
dataRef : 'dataref.to.subscribe.to.goes.here',
})
Members
originRef
A string reference that can be set to uniquely identify this object.
originX
The X
position of this object on a canvas.
originY
The Y
position of this object on a canvas.
originW
The width of the object when displayed on a canvas.
originH
The height of the ojbect when displayed on a canvas.
textCleared
A convenience member to check whether or not the text has been cleared.
sprites
A directory of all the sprites that are local to the device.
offsetTextX
The offset to apply to the X
position of this object on a canvas.
offsetTextY
The offset to apply to the Y
position of this object on a canvas.
initialValue
The initial value to set to the text.
border
The border style (if applicable).
bitmapText
The bitmap text to load from the asset loader.
forceAlignRight
Whether to force the text to the right of it's container.
forceVerticalCenter
Whether to force the text to the middle of it's container, vertically.
dataRef
The dataref that this element is subscribed to.
triggers
A collection of triggers that will change the style of the text based on it's current value.
textTargetValue
The value to set the text to on the next update/render.
textCurrentValue
The current text value of the element.
Methods
updateText(newText)
Updates the text that is rendered.
debugModeOn()
Shows colored regions for debugging.
debugModeOff()
Hides colored regions for debugging.
load()
Calls the setup method after assets have been loaded.