TagsA - Z



class WorldSpaceCanvas2D extends Canvas2D


new WorldSpaceCanvas2D(scene, size, settings)

Create a new 2D WorldSpace Rendering Canvas, it is a 2D rectangle that has a size (width/height) and a world transformation information to place it in the world space.

This kind of canvas can't have its Primitives directly drawn in the Viewport, they need to be cached in a bitmap at some point, as a consequence the DONT_CACHE strategy is unavailable. For now only CACHESTRATEGY_CANVAS is supported, but the remaining strategies will be soon.


Name Type Description
scene Scene the Scene that owns the Canvas
size Size the dimension of the Canvas in World Space
optional settings { children: Array<Prim2DBase>, id: string, worldPosition: Vector3, worldRotation: Quaternion, sideOrientation: number, cachingStrategy: number, enableInteraction: boolean, isVisible: boolean, backgroundRoundRadius: number, backgroundFill: IBrush2D, string: string, backgroundBorder: IBrush2D, string: string, backgroundBorderThickNess: number, customWorldSpaceNode: Node, maxAdaptiveCanvasSize: number, paddingTop: number, string: string, paddingLeft: number, string: string, paddingRight: number, string: string, paddingBottom: number, string: string, padding: string } a combination of settings, possible ones are


dispose() → boolean