Class Text
Extends
View.
multi-line, line-wrapped text dislay !CONSTRUCTOR PARAMETERS ARE PROVIDED IN A OBJECT LITERAL!
Defined in: gamejs-gui.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Text(font, text, justify, parent, size, position, surface, visible)
|
Method Attributes | Method Name and Description |
---|---|
paint()
|
|
setText(text)
set text
|
- Methods borrowed from class View:
- addChild, blitChild, center, despatchEvent, destroy, draw, getGUI, getPosition, getRect, getSize, hide, isFocused, isHovered, isVisible, move, moveRelative, on, refresh, removeChild, resize, show, update
Class Detail
Text(font, text, justify, parent, size, position, surface, visible)
- Parameters:
- {CachedFont} font
- {String} text
- {Bool} justify
- if true, text is justified. By default, it's left-aligned
- {View} parent
- parent element
- {Array} size
- array containing width & height of the element, eg. [width, height]
- {Array} position
- position of the view relative to parent, eg. [x, y]. OPTIONAL, default [0, 0]
- {gamejs.Surface} surface
- surface to render this view on, OPTIONAL
- {Bool} visible
- is this view visible? OPTIONAL, DEFAULT true
Method Detail
paint()
setText(text)
set text
- Parameters:
- {String} text