RenderLists2D

View source

Camera render-list component for opaque 2D passes.

Place this component on a camera entity with Camera and GlobalTransform2D. It specializes RenderLists for 2D entries; RenderLists3D is the corresponding 3D component.

Use the inherited RenderLists#getOpaquePass, RenderLists#setOpaquePass, and RenderLists#clear APIs to manage its material-keyed passes.

Examples

import { createCamera2D } from '@wimaengine/render-core'

// The prefab includes GlobalTransform2D, Camera, and RenderLists2D.
const cameraEntity = world.spawn(createCamera2D())

Constructor


constructor()

Methods


staticcopy(_source: RenderLists2D, target?: RenderLists2D): RenderLists2D

View source

Returns the copy target without copying any render passes.

The source is ignored. Without a target, this method creates and returns an empty RenderLists2D; with a target, it returns that exact object unchanged, including any passes it already contains.

Parameters

NameDescriptionDefault
_source

Render list ignored by this no-op copy.

—
target?

Object to return; defaults to a new render list.

...

Returns

The new default target or the supplied target.

staticclone(target: RenderLists2D): RenderLists2D

View source

Returns a new empty render list instead of cloning render passes.

The input is ignored. This method delegates to RenderLists2D.copy without a copy target, so it always returns a new RenderLists2D whose inherited opaque-pass map is empty.

Parameters

NameDescriptionDefault
target

Render list ignored by this no-op clone.

—

Returns

A new empty 2D render list.

staticserialize(_value: RenderLists2D): object

View source

Returns the empty serialized representation for a 2D render list.

The value is ignored and the inherited opaque passes are not serialized; each call returns a new empty object.

Parameters

NameDescriptionDefault
_value

Render list ignored during serialization.

—

Returns

An empty serialized representation.

staticdeserialize(_value: unknown, out?: RenderLists2D): RenderLists2D

View source

Returns an output render list without reading serialized data.

The serialized input is ignored. Without out, this method creates and returns a new empty RenderLists2D; with out, it returns that exact object unchanged, so no opaque passes are restored or replaced.

Parameters

NameDescriptionDefault
_value

Serialized value ignored during deserialization.

—
out?

Existing output to return unchanged.

...

Returns

The new default output or the supplied output.