gophergfx
    Preparing search index...

    Class GfxAppAbstract

    The base class for a GopherGfx application.

    Index
    • Constructor for the GfxApp class

      Parameters

      • enableStencilBuffer: boolean = false

        Boolean value to enable/disable the stencil buffer

      Returns GfxApp

    assetManager: AssetManager

    Coordinates asynchronous loading of external assets.

    camera: Camera

    The camera used by the GfxApp instance.

    renderer: Renderer

    The renderer used by the GfxApp instance.

    runInBackground: boolean

    A boolean indicating whether the GfxApp should continue to run in the background.

    scene: Scene

    The scene used by the GfxApp instance.

    • Abstract method to be implemented by any subclass of GfxApp. Creates the scene for the application.

      Returns void

    • Converts mouse coordinates to normalized device coordinates

      Parameters

      • mouseX: number

        The x coordinate of the mouse

      • mouseY: number

        The y coordinate of the mouse

      Returns Vector2

      The normalized device coordinates

    • Returns true if the application is paused

      Returns boolean

      True if the application is paused, false otherwise

    • Late update method to be called just before drawing the scene. Optional method - subclasses do not need to override it.

      Parameters

      • deltaTime: number

        Time elapsed since the last update call (in seconds)

      Returns void

    • Method called after all assets are loaded before entering main loop. Optional method - subclasses do not need to override it.

      Returns void

    • Handles focus events to pause and resume the application

      Parameters

      • event: FocusEvent

        The FocusEvent

      Returns void

    • Handles focus events to pause and resume the application

      Parameters

      • event: FocusEvent

        The FocusEvent

      Returns void

    • Method called when a key is pressed. Subclasses can override this method to handle the event.

      Parameters

      • event: KeyboardEvent

        The KeyboardEvent object associated with the key press

      Returns void

    • Method called when a key is released. Subclasses can override this method to handle the event.

      Parameters

      • event: KeyboardEvent

        The KeyboardEvent object associated with the key release

      Returns void

    • Method called when the mouse is clicked. Subclasses can override this method to handle the event.

      Parameters

      • event: MouseEvent

        The MouseEvent object associated with the mouse click

      Returns void

    • Method called when the mouse is moved. Subclasses can override this method to handle the event.

      Parameters

      • event: MouseEvent

        The MouseEvent object associated with the mouse movement

      Returns void

    • Method called when the mouse is released. Subclasses can override this method to handle the event.

      Parameters

      • event: MouseEvent

        The MouseEvent object associated with the mouse release

      Returns void

    • Method called when the mouse wheel is moved. Subclasses can override this method to handle the event.

      Parameters

      • event: WheelEvent

        The WheelEvent object associated with the mouse wheel movement

      Returns void

    • Creates a simulated mouse up event for touch input

      Parameters

      • event: TouchEvent

      Returns void

    • Creates a simulated mouse move event for touch input

      Parameters

      • event: TouchEvent

      Returns void

    • Creates a simulated mouse down event for touch input

      Parameters

      • event: TouchEvent

      Returns void

    • Resizes the viewport of the GfxApp

      Returns void

    • Creates the scene and starts the program

      Returns void

    • Abstract method to be implemented by any subclass of GfxApp. Updates the application's state with the given deltaTime.

      Parameters

      • deltaTime: number

        Time elapsed since the last update call (in seconds)

      Returns void

    • Gets the singleton instance of the GfxApp class.

      Returns GfxApp

      The singleton instance of the GfxApp class.