gameforge - v0.1.12
    Preparing search index...

    Interface IRenderer<VIEW>

    Standard Interface for a Pixi renderer.

    PIXI

    interface IRenderer<VIEW extends ICanvas = ICanvas> {
        autoDensity: boolean;
        background: BackgroundSystem;
        events: EventSystem;
        extract: IExtract;
        height: number;
        lastObjectRendered: IRenderableObject;
        multisample?: MSAA_QUALITY;
        options: IRendererOptions;
        plugins: IRendererPlugins;
        prepare: BasePrepare;
        rendererLogId: string;
        renderingToScreen: boolean;
        resolution: number;
        runners: { [key: string]: Runner<any, any[]> };
        screen: Rectangle;
        type: RENDERER_TYPE;
        view: VIEW;
        width: number;
        addListener<T extends string | symbol>(
            event: T,
            fn: (...args: any[]) => void,
            context?: any,
        ): this;
        addRunners(...runnerIds: string[]): void;
        addSystem(
            ClassRef: ISystemConstructor<IRenderer<ICanvas>>,
            name: string,
        ): this;
        clear(): void;
        destroy(removeView?: boolean): void;
        emit<T extends string | symbol>(event: T, ...args: any[]): boolean;
        emitWithCustomOptions(
            runner: Runner,
            options: Record<string, unknown>,
        ): void;
        eventNames(): (string | symbol)[];
        generateTexture(
            displayObject: IRenderableObject,
            options?: IGenerateTextureOptions,
        ): RenderTexture;
        listenerCount(event: string | symbol): number;
        listeners<T extends string | symbol>(
            event: T,
        ): ((...args: any[]) => void)[];
        off<T extends string | symbol>(
            event: T,
            fn?: (...args: any[]) => void,
            context?: any,
            once?: boolean,
        ): this;
        on<T extends string | symbol>(
            event: T,
            fn: (...args: any[]) => void,
            context?: any,
        ): this;
        once<T extends string | symbol>(
            event: T,
            fn: (...args: any[]) => void,
            context?: any,
        ): this;
        removeAllListeners(event?: string | symbol): this;
        removeListener<T extends string | symbol>(
            event: T,
            fn?: (...args: any[]) => void,
            context?: any,
            once?: boolean,
        ): this;
        render(
            displayObject: IRenderableObject,
            options?: IRendererRenderOptions,
        ): void;
        reset(): void;
        resize(width: number, height: number): void;
        setup(config: ISystemConfig<IRenderer<ICanvas>>): void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    autoDensity: boolean

    Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.

    background: BackgroundSystem

    Background color, alpha and clear behavior

    events: EventSystem
    extract: IExtract
    height: number

    the height of the screen

    lastObjectRendered: IRenderableObject

    the last object rendered by the renderer. Useful for other plugins like interaction managers

    multisample?: MSAA_QUALITY

    The number of MSAA samples of the renderer.

    The options passed in to create a new instance of the renderer.

    Collection of plugins

    prepare: BasePrepare
    rendererLogId: string

    When logging Pixi to the console, this is the name we will show

    renderingToScreen: boolean

    Flag if we are rendering to the screen vs renderTexture

    resolution: number

    The resolution / device pixel ratio of the renderer.

    runners: { [key: string]: Runner<any, any[]> }

    a collection of runners defined by the user

    screen: Rectangle

    Measurements of the screen. (0, 0, screenWidth, screenHeight). Its safe to use as filterArea or hitArea for the whole stage.

    The type of the renderer.

    PIXI.RENDERER_TYPE

    view: VIEW

    The canvas element that everything is drawn to.

    width: number

    the width of the screen

    Methods

    • Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • fn: (...args: any[]) => void
      • Optionalcontext: any

      Returns this

    • Create a bunch of runners based of a collection of ids

      Parameters

      • ...runnerIds: string[]

        the runner ids to add

      Returns void

    • Add a new system to the renderer.

      Parameters

      • ClassRef: ISystemConstructor<IRenderer<ICanvas>>

        Class reference

      • name: string

        Property name for system, if not specified will use a static name property on the class itself. This name will be assigned as s property on the Renderer so make sure it doesn't collide with properties on Renderer.

      Returns this

      Return instance of renderer

    • Returns void

    • destroy the all runners and systems. Its apps job to

      Parameters

      • OptionalremoveView: boolean

      Returns void

    • Calls each of the listeners registered for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • ...args: any[]

      Returns boolean

    • A function that will run a runner and call the runners function but pass in different options to each system based on there name.

      E.g. If you have two systems added called systemA and systemB you could call do the following:

      system.emitWithCustomOptions(init, {
      systemA: {...optionsForA},
      systemB: {...optionsForB},
      });

      init would be called on system A passing optionsForA and on system B passing optionsForB.

      Parameters

      • runner: Runner

        the runner to target

      • options: Record<string, unknown>

        key value options for each system

      Returns void

    • Return an array listing the events for which the emitter has registered listeners.

      Returns (string | symbol)[]

    • Return the number of listeners listening to a given event.

      Parameters

      • event: string | symbol

      Returns number

    • Return the listeners registered for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T

      Returns ((...args: any[]) => void)[]

    • Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • Optionalfn: (...args: any[]) => void
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this

    • Add a listener for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • fn: (...args: any[]) => void
      • Optionalcontext: any

      Returns this

    • Add a one-time listener for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • fn: (...args: any[]) => void
      • Optionalcontext: any

      Returns this

    • Remove all listeners, or those of the specified event.

      Parameters

      • Optionalevent: string | symbol

      Returns this

    • Remove the listeners of a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • Optionalfn: (...args: any[]) => void
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this

    • Returns void

    • Parameters

      • width: number
      • height: number

      Returns void

    • Set up a system with a collection of SystemClasses and runners. Systems are attached dynamically to this class when added.

      Parameters

      Returns void