SystemRender

SystemRender

Creates render systems.

Constructor

new SystemRender($parameters)

Description:
  • Creates a new render system.
Source:
Example
const system = new SystemRender({$color, $container, $resolution});
system.initiate();
system.tick($stage);
Parameters:
Name Type Attributes Description
$parameters Object The given parameters.
$parameters.$color Vector3 <optional>
The rendering background color to use.
$parameters.$container HTMLElement The container on which to attach the canvas.
$parameters.$resolution Vector2 The rendering resolution to use.

Members

(readonly) UNITTEXTURE0 :0

Description:
  • Stores the texture unit for the textures to preload.
Source:
Stores the texture unit for the textures to preload.
Type:
  • 0

(readonly) UNITTEXTURE1 :1

Description:
  • Stores the texture unit for the color textures.
Source:
Stores the texture unit for the color textures.
Type:
  • 1

(readonly) UNITTEXTURE2 :2

Description:
  • Stores the texture unit for the opacity textures.
Source:
Stores the texture unit for the opacity textures.
Type:
  • 2

Methods

hasAssetLoaded($asset) → {boolean}

Description:
  • Checks if the system has loaded the given asset.
Source:
Parameters:
Name Type Description
$asset string The asset source.
Returns:
Type
boolean

loadTexture($content) → {Promise.<WebGLTexture>}

Description:
  • Loads the texture from the given texture file content.
Source:
Parameters:
Name Type Description
$content Response The texture file content.
Returns:
Type
Promise.<WebGLTexture>

onInitiate()

Description:
  • Called when the system is being initiated.
Source:

onTerminate() → {void|Promise.<void>}

Description:
  • Called when the system is being terminated.
Source:
Returns:
Type
void | Promise.<void>

onTick($parameters)

Description:
  • Called when the system is being updated by one tick update.
Source:
Parameters:
Name Type Description
$parameters Object The given parameters.
$parameters.$stage Stage The stage on which to execute the system.
$parameters.$timetick number The tick duration (in ms).

setColor($color)

Description:
  • Sets the rendering background color.
Source:
Parameters:
Name Type Description
$color Vector3 The rendering background color to set.

setResolution($resolution)

Description:
  • Sets the rendering resolution.
Source:
Parameters:
Name Type Description
$resolution Vector2 The rendering resolution to set.