Reference Source Test
public class | source

Overlay

Shows an popup overlay when the mouse is over a character or enemy that displays information about them

Constructor Summary

Public Constructor
public

constructor(input: Input)

Default constructor

Member Summary

Public Members
public

attackInfo: DOMElement

Jquery reference to the attack info box

public

details: DOMElement

Jquery reference to the details of the attack info box

public

health: DOMElement

Jquery reference to the name of the health bar of the attack info box

public

A reference to the entity they are hovering over

public

image: DOMElement

Jquery reference to the image section of the attack info box

public

Input class

public

name: DOMElement

Jquery reference to the name of the attack info box

public

A callback for when the overlay is done updating

Method Summary

Public Methods
public

clean()

Cleans out the details and the entity they're hovering on

public

Fades in the attack info

public

Returns an instance of the game object

public

Check if the entity has a health bar

public

hide()

Fades out and hides the attack info

public

Check to see if the atttack info is currently visible

public

onUpdate(callback: Function)

Sets an update callback

public

update(entity: Entity): Boolean

Update the overlay

public

Checks whether or not this is an entity they can interact with

Public Constructors

public constructor(input: Input) source

Default constructor

Params:

NameTypeAttributeDescription
input Input

reference to the Input class

Public Members

public attackInfo: DOMElement source

Jquery reference to the attack info box

public details: DOMElement source

Jquery reference to the details of the attack info box

public health: DOMElement source

Jquery reference to the name of the health bar of the attack info box

public hovering: Entity source

A reference to the entity they are hovering over

public image: DOMElement source

Jquery reference to the image section of the attack info box

public input: Input source

Input class

public name: DOMElement source

Jquery reference to the name of the attack info box

public updateCallback: Function source

A callback for when the overlay is done updating

Public Methods

public clean() source

Cleans out the details and the entity they're hovering on

public display() source

Fades in the attack info

public getGame(): Game source

Returns an instance of the game object

Return:

Game

public hasHealth(): Boolean source

Check if the entity has a health bar

Return:

Boolean

Rturns true if this entity is a (mob or player)

public hide() source

Fades out and hides the attack info

public isVisible(): Boolean source

Check to see if the atttack info is currently visible

Return:

Boolean

public onUpdate(callback: Function) source

Sets an update callback

Params:

NameTypeAttributeDescription
callback Function

called when the overlay is updated

public update(entity: Entity): Boolean source

Update the overlay

Params:

NameTypeAttributeDescription
entity Entity

The entity they are attacking

Return:

Boolean

returns false if invalid entity or currently visible

public validEntity(entity: Entity): Boolean source

Checks whether or not this is an entity they can interact with

Params:

NameTypeAttributeDescription
entity Entity

the entity they want to interact with

Return:

Boolean

Returns true if this is not a player or projectile