The system class is the entry point of the Rhodonite library.

await Rn.System.init({
approach: Rn.ProcessApproach.DataTexture,
canvas: document.getElementById('world') as HTMLCanvasElement,
});

... (create something) ...

Rn.System.startRenderLoop((time, _myArg1, _myArg2) => {
Rn.System.process([expression]);
}, myArg1, myArg2);

Accessors

Methods

  • Initialize the Rhodonite system.

    Parameters

    • desc: SystemInitDescription

    Returns Promise<void>

    Don't forget await to use this method.

    await Rn.System.init({
    approach: Rn.ProcessApproach.DataTexture,
    canvas: document.getElementById('world') as HTMLCanvasElement,
    });
  • A Simple version of process method

    Parameters

    • clearColor: Vector4 = ...

      color to clear the canvas

    Returns void

    No need to create expressions and renderPasses and to register entities, etc... It's suitable for simple use cases like sample apps.

  • Starts a render loop.

    Parameters

    • renderLoopFunc: ((time: number, ...args: any[]) => void)

      function to be called in each frame

        • (time, ...args): void
        • Parameters

          • time: number
          • Rest...args: any[]

          Returns void

    • Rest...args: any[]

      arguments you want to be passed to renderLoopFunc

    Returns void

    Rn.System.startRenderLoop((time, _myArg1, _myArg2) => {
    Rn.System.process([expression]);
    }, myArg1, myArg2);