Skip to content
M2O Scripting APIScripting reference
Runtime classClient APIGenerated

Render2DCanvas

Defined in: client/api.d.ts:314

Resource-owned root attached to one native Render2D layer.

new Render2DCanvas(): Render2DCanvas

Render2DCanvas

clear(): boolean

Defined in: client/api.d.ts:388

Destroys every node owned by this canvas.

boolean


createContainer(options?): Render2DContainer | null

Defined in: client/api.d.ts:368

Creates a native parent node.

Render2DNodeOptions

Render2DContainer | null


createRectangle(options?): Render2DRectangle | null

Defined in: client/api.d.ts:373

Creates a colored native rectangle.

Render2DRectangleOptions

Render2DRectangle | null


createText(options): Render2DText | null

Defined in: client/api.d.ts:378

Creates a native text region.

Render2DTextOptions

Render2DText | null


createTexture(options): Render2DTexture | null

Defined in: client/api.d.ts:383

Creates a textured native rectangle; unresolved resources remain hidden.

Render2DTextureOptions

Render2DTexture | null


destroy(): boolean

Defined in: client/api.d.ts:393

Destroys this canvas and all of its nodes.

boolean


setClipRect(left, top, right, bottom): boolean

Defined in: client/api.d.ts:363

Sets the normalized clipping rectangle.

number

number

number

number

boolean

clipping: boolean

Defined in: client/api.d.ts:338

Canvas clipping state.


readonly clipRect: Render2DRect

Defined in: client/api.d.ts:358

Current normalized clipping rectangle.


readonly destroyed: boolean

Defined in: client/api.d.ts:328

Whether this handle is no longer valid.


readonly id: number

Defined in: client/api.d.ts:318

Opaque canvas identifier.


readonly layer: "foreground" | "hudHints" | "shopSubtitles" | "menus" | "phone" | "cutscene" | "hud"

Defined in: client/api.d.ts:323

Native layer name.


nonOverlapGroup: number

Defined in: client/api.d.ts:353

Native non-overlap group.


pixelClipping: boolean

Defined in: client/api.d.ts:343

Pixel clipping state.


useAllMonitors: boolean

Defined in: client/api.d.ts:348

Whether the canvas spans all monitors.


visible: boolean

Defined in: client/api.d.ts:333

Canvas visibility.