new DialogueBox()
DialogueBox handles text display with typewriter effect.
- Source
Methods
advance()
Advance to next line or complete current typing.
- Source
draw(ctx, x, y, width, height)
Draw the dialogue box.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx | CanvasRenderingContext2D | |
x | number | |
y | number | |
width | number | |
height | number |
- Source
skip()
Skip entire dialogue.
- Source
start(lines)
Start a dialogue sequence.
Parameters:
| Name | Type | Description |
|---|---|---|
lines | Array.<{speaker: string, text: string, portrait: (string|undefined)}> |
- Source
update(deltaTime)
Update typewriter effect.
Parameters:
| Name | Type | Description |
|---|---|---|
deltaTime | number |
- Source