Home Reference Source Repository
import MessageWindow from 'dh3dlib/js/base/MessageWindow.js'
public class | source

MessageWindow

Extends:

DH2DObject → MessageWindow

MessageWindow class

Constructor Summary

Public Constructor
public

constructor

Method Summary

Public Methods
public

animate(elapsedTime: float): void

animate message window

public

close(): void

close message window (start animation)

public

drawBalloon(speakerX: float, speakerY: float, left: float, top: float, width: float, height: float): void

draw balloon to given position

public

getCanvas(): HTMLCanvasElement

get Canvas object

public

get context

public

getIcon(): HTMLImageElement

get icon image

public

getMaxWidth(): int

get max width

public

get message text

public

get position offset

public

get screen offset

public

getState(): int

get state of message window

public

open(): void

open message window (start animation)

public

render(): void

render message window

public

setCanvas(canvas: HTMLCanvasElement): void

set Canvas object

public

set context

public

setIcon(icon: HTMLImageElement): void

set icon image

public

setMaxWidth(maxWidth: int): void

set max width

public

setMessage(message: string): void

set message text

public

setOffset(x: float, y: float, z: float): void

set position offset

public

setScreenOffset(x: float, y: float, z: float): void

set screen offset

public

set up balloon context

public

set up text context

Inherited Summary

From class DH2DObject
public

animate(elapsedTime: float): void

animate object

public

move(elapsedTime: float): void

move object

public

render(): void

render object

Public Constructors

public constructor source

constructor

Public Methods

public animate(elapsedTime: float): void source

animate message window

Override:

DH2DObject#animate

Params:

NameTypeAttributeDescription
elapsedTime float

elapsed time (seconds) from previous frame

Return:

void

public close(): void source

close message window (start animation)

Return:

void

public drawBalloon(speakerX: float, speakerY: float, left: float, top: float, width: float, height: float): void source

draw balloon to given position

Params:

NameTypeAttributeDescription
speakerX float
speakerY float
left float
top float
width float
height float

Return:

void

public getCanvas(): HTMLCanvasElement source

get Canvas object

Return:

HTMLCanvasElement

Canvas object

public getContext(): CanvasRenderingContext2D source

get context

Return:

CanvasRenderingContext2D

context

public getIcon(): HTMLImageElement source

get icon image

Return:

HTMLImageElement

icon image

public getMaxWidth(): int source

get max width

Return:

int

max width of message window

public getMessage(): string source

get message text

Return:

string

message text

public getOffset(): Vector3 source

get position offset

Return:

Vector3

position

public getScreenOffset(): Vector3 source

get screen offset

Return:

Vector3

screen offset

public getState(): int source

get state of message window

Return:

int

0: ready, 1: opening, 2: show string, 3: waiting, 4: closing

public open(): void source

open message window (start animation)

Return:

void

public render(): void source

render message window

Override:

DH2DObject#render

Return:

void

public setCanvas(canvas: HTMLCanvasElement): void source

set Canvas object

Params:

NameTypeAttributeDescription
canvas HTMLCanvasElement

canvas object

Return:

void

public setContext(context: CanvasRenderingContext2D): void source

set context

Params:

NameTypeAttributeDescription
context CanvasRenderingContext2D

Return:

void

public setIcon(icon: HTMLImageElement): void source

set icon image

Params:

NameTypeAttributeDescription
icon HTMLImageElement

icon image

Return:

void

public setMaxWidth(maxWidth: int): void source

set max width

Params:

NameTypeAttributeDescription
maxWidth int

Return:

void

public setMessage(message: string): void source

set message text

Params:

NameTypeAttributeDescription
message string

text to show

Return:

void

public setOffset(x: float, y: float, z: float): void source

set position offset

Params:

NameTypeAttributeDescription
x float

X value

y float

Y value

z float

Z value

Return:

void

public setScreenOffset(x: float, y: float, z: float): void source

set screen offset

Params:

NameTypeAttributeDescription
x float

X value

y float

Y value

z float

Z value

Return:

void

public setupBalloonContext(): void source

set up balloon context

Return:

void

public setupTextContext(): void source

set up text context

Return:

void