Reference Source Test
public class | source

Bubble

Creates player speach bubbles

Constructor Summary

Public Constructor
public

constructor(game: Game)

Default constructor

Member Summary

Public Members
public

An object with all of the bubbles to display

public

container: DOMElement

Jquery reference to the display bubble for text messages

public

Instance of the game object

Method Summary

Public Methods
public

clean(): *

Destroy all the active bubbles

public

create(id: Number, message: String, time: Number, duration: Number): Blob

Create a bubble message

public

destroy(id: Number): *

Delete a specific bubble

public

get(id: Number): Bubble

Fetch a specific bubble

public

setTo(entity: Entity): *

Set a speech bubble to a specific entity

public

update(time: Number): *

Update the display of the bubbles (automatically disappear over time)

Public Constructors

public constructor(game: Game) source

Default constructor

Params:

NameTypeAttributeDescription
game Game

instance of the game class

Public Members

public bubbles: Blob[] source

An object with all of the bubbles to display

public container: DOMElement source

Jquery reference to the display bubble for text messages

public game: Game source

Instance of the game object

Public Methods

public clean(): * source

Destroy all the active bubbles

Return:

*

null, empty array of bubbles

public create(id: Number, message: String, time: Number, duration: Number): Blob source

Create a bubble message

Params:

NameTypeAttributeDescription
id Number

the id of the bubble message

message String

contents of the bubble

time Number

when the bubble will reset

duration Number
  • optional
  • default: 5000

duration set on the Blob's internal Timer

Return:

Blob

an instance of the bubble message

public destroy(id: Number): * source

Delete a specific bubble

Params:

NameTypeAttributeDescription
id Number

the id of the bubble message

Return:

*

null, the bubble is removed from the array

public get(id: Number): Bubble source

Fetch a specific bubble

Params:

NameTypeAttributeDescription
id Number

the id of the bubble message

Return:

Bubble

an instance of the bubble message

public setTo(entity: Entity): * source

Set a speech bubble to a specific entity

Params:

NameTypeAttributeDescription
entity Entity

an entity in the game

Return:

*

null, speech bubble shows in the location of the entity

public update(time: Number): * source

Update the display of the bubbles (automatically disappear over time)

Params:

NameTypeAttributeDescription
time Number

the current timestamp

Return:

*

null, deletes expired speech bubbles