A live-view host. Attach one with engine.attachCanvas().
Implements#
Accessors#
background#
The terminal’s background colour, once it has answered OSC 11.
Returns#
object
| Name | Type |
|---|---|
r |
number |
g |
number |
b |
number |
Constructors#
Constructor#
| Parameter | Type |
| —— | —— |
| options? | TerminalCanvasOptions |
options? | TerminalCanvasOptions |Returns#
TerminalCanvas
Methods#
attach()#
Called once when the canvas is attached.
Returns#
void
Implementation of#
Signature#
attach(): voiddetach()#
Called once when the canvas is detached or the engine is disposed.
Returns#
void
Implementation of#
Signature#
detach(): voidbeforeUpdate()#
Before update(): size the surface and request a frame.
update(): size the surface and request a frame.Parameters#
| Parameter | Type |
|---|---|
surface |
FrameSurface |
Returns#
void
Implementation of#
Signature#
beforeUpdate(surface: FrameSurface): voidafterUpdate()#
After update(): present the frame, if one was produced.
update(): present the frame, if one was produced.Parameters#
| Parameter | Type |
|---|---|
info |
FrameInfo |
surface |
FrameSurface |
Returns#
void
Implementation of#
Signature#
afterUpdate(info: FrameInfo, surface: FrameSurface): voidrequestFrame()#
Schedule the next tick. Engine time advances only inside update(), so waiting on input alone freezes playback.
update(), so waiting on input alone freezes playback.Parameters#
| Parameter | Type |
|---|---|
tick |
() => void |
busy |
boolean |
Returns#
object
Implementation of#
Signature#
requestFrame(tick: () => void, busy: boolean): object