TextKit Basic
CanvasView
Initializing
In TextKit, A CanvasView
is an implementation of the ViewProtocol
that lets you compose multiple ViewProtocol
s together. You can add any view, anywhere inside (or even outside of the canvas) and in any z-index you wish for.
tsconst hello = new TextKit .LineView ( "Hello, World", renderer , { color : "red" }) const canvas = new TextKit .CanvasView ( VIEW_PORT_WIDTH , VIEW_PORT_HEIGHT , renderer ) canvas .add ( hello , 0, // X 0, // Y 0, // Z or Z-index)
tsconst hello = new TextKit .LineView ( "Hello, World", renderer , { color : "red" }) const canvas = new TextKit .CanvasView ( VIEW_PORT_WIDTH , VIEW_PORT_HEIGHT , renderer ) canvas .add ( hello , 0, // X 0, // Y 0, // Z or Z-index)