Class: Caption

Caption

new Caption()

Creates a new Caption object. Use captions to communicate short messages to users like a title or simple instructions like 'click for more particles'.
Source:

Members

<private> el

Holds a reference to the caption's DOM elements.
Source:

Methods

draw()

A noop.
Source:

init(opt_options=)

Intializes an instance of Caption.
Parameters:
Name Type Argument Default Description
opt_options= Object <optional>
A map of initial properties.
opt_options.world Object <optional>
A world.
opt_options.position string <optional>
'top left' A text representation of the caption's location. Possible values are 'top left', 'top center', 'top right', 'bottom left', 'bottom center', 'bottom right', 'center'.
opt_options.text string <optional>
'' The caption's text.
opt_options.opacity number <optional>
0.75 The caption's opacity.
opt_options.color Array <optional>
255, 255, 255 The caption's color.
opt_options.borderWidth number <optional>
1 The caption's border width.
opt_options.borderStyle string <optional>
'solid' The caption's border style.
opt_options.borderColor Array <optional>
204, 204, 204 The caption's border color.
Source:

remove()

Removes the caption's DOM element.
Source:

update(text)

Updates the caption's text.
Parameters:
Name Type Description
text string The text to replace the caption's current text.d
Source: