Skip to content
M2O Scripting APIScripting reference
Data shapeClient APIGenerated

Render2DCanvas

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

Resource-owned root attached to one native Render2D layer.

clear(): boolean

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

Destroys every node owned by this canvas.

boolean


createContainer(options?): Render2DContainer | null

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

Creates a native parent node.

Render2DNodeOptions

Render2DContainer | null


createRectangle(options?): Render2DRectangle | null

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

Creates a colored native rectangle.

Render2DRectangleOptions

Render2DRectangle | null


createText(options): Render2DText | null

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

Creates a native text region.

Render2DTextOptions

Render2DText | null


createTexture(options): Render2DTexture | null

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

Creates a textured native rectangle; unresolved resources remain hidden.

Render2DTextureOptions

Render2DTexture | null


destroy(): boolean

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

Destroys this canvas and all of its nodes.

boolean


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

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

Sets the normalized clipping rectangle.

number

number

number

number

boolean

clipping: boolean

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

Canvas clipping state.


readonly clipRect: Render2DRect

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

Current normalized clipping rectangle.


readonly destroyed: boolean

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

Whether this handle is no longer valid.


readonly id: number

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

Opaque canvas identifier.


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

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

Native layer name.


nonOverlapGroup: number

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

Native non-overlap group.


pixelClipping: boolean

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

Pixel clipping state.


useAllMonitors: boolean

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

Whether the canvas spans all monitors.


visible: boolean

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

Canvas visibility.