CLASSES
TagsA - Z

ScreenSpaceCanvas2D

Description

class ScreenSpaceCanvas2D extends Canvas2D

Constructor

new ScreenSpaceCanvas2D(scene, settings)

Create a new 2D ScreenSpace Rendering Canvas, it is a 2D rectangle that has a size (width/height) and a position relative to the bottom/left corner of the screen.

ScreenSpace Canvas will be drawn in the Viewport as a 2D Layer lying to the top of the 3D Scene. Typically used for traditional UI.

All caching strategies will be available.

PLEASE NOTE: the origin of a Screen Space Canvas is set to [0;0] (bottom/left) which is different than the default origin of a Primitive which is centered [0.5;0.5]

Parameters

Name Type Description
scene Scene the Scene that owns the Canvas
optional settings { children: Array<Prim2DBase>, id: string, x: number, y: number, position: Vector2, origin: Vector2, width: number, height: number, size: Size, renderingPhase: { camera: Camera, renderingGroupID: number }, designSize: Size, designUseHorizAxis: boolean, cachingStrategy: number, cacheBehavior: number, enableInteraction: boolean, isVisible: boolean, backgroundRoundRadius: number, backgroundFill: IBrush2D, string: string, backgroundBorder: IBrush2D, string: string, backgroundBorderThickNess: 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