Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebGLRenderer

Hierarchy

Index

Constructors

constructor

Properties

CONTEXT_UID

CONTEXT_UID: number

_activeRenderTarget

_activeRenderTarget: RenderTarget

Protected _activeShader

_activeShader: Shader

Protected _backgroundColor

_backgroundColor: number

Protected _backgroundColorRgba

_backgroundColorRgba: number[]

Protected _backgroundColorString

_backgroundColorString: string

Protected _contextOptions

_contextOptions: object

Type declaration

  • alpha: boolean
  • Optional antiAlias?: boolean
  • premultipliedAlpha: boolean
  • Optional preseveDrawingBuffer?: boolean
  • stencil: boolean

Protected _lastObjectRendered

_lastObjectRendered: DisplayObject

Protected _tempDisplayObjectParent

_tempDisplayObjectParent: Container

autoResize

autoResize: boolean

blendModes

blendModes: any

boundTextures

boundTextures: Texture[]

clearBeforeRender

clearBeforeRender: boolean

currentRenderer

currentRenderer: ObjectRenderer

Protected drawModes

drawModes: any

emptyRenderer

emptyRenderer: ObjectRenderer

extract

extract: WebGLExtract

filterManager

filterManager: FilterManager

gl

gl: WebGLRenderingContext

handleContextLost

handleContextLost: function

Type declaration

    • (event: WebGLContextEvent): void
    • Parameters

      • event: WebGLContextEvent

      Returns void

handleContextRestored

handleContextRestored: function

Type declaration

    • (): void
    • Returns void

height

height: number

interaction

interaction: InteractionManager

maskManager

maskManager: MaskManager

options

plugins

plugins: any

preserveDrawingBuffer

preserveDrawingBuffer: boolean

renderingToScreen

renderingToScreen: boolean

resolution

resolution: number

roundPixels

roundPixels: boolean

screen

screen: Rectangle

Optional state

state: WebGLState

Optional stencilManager

stencilManager: StencilManager

Optional textureGC

Optional textureManager

textureManager: TextureManager

transparent

transparent: boolean

type

type: number

view

view: HTMLCanvasElement

width

width: number

Static EventEmitter

EventEmitter: object

Type declaration

  • constructor: function
    • Returns EventEmitter

  • prefixed: string | boolean

Static ___plugins

___plugins: any

Static prefixed

prefixed: string | boolean

Methods

Protected _initContext

  • _initContext(): void
  • Returns void

addListener

  • addListener(event: "prerender" | "postrender", fn: function, context?: any): this
  • addListener(event: "context", fn: function, context?: any): this
  • Parameters

    • event: "prerender" | "postrender"
    • fn: function
        • (): void
        • Returns void

    • Optional context: any

    Returns this

  • Parameters

    • event: "context"
    • fn: function
        • (gl: WebGLRenderingContext): void
        • Parameters

          • gl: WebGLRenderingContext

          Returns void

    • Optional context: any

    Returns this

bindRenderTarget

bindRenderTexture

bindShader

  • Parameters

    • shader: Shader
    • Optional autoProject: boolean

    Returns WebGLRenderer

bindTexture

  • bindTexture(texture: Texture | BaseTexture, location?: number, forceLocation?: boolean): number
  • Parameters

    • texture: Texture | BaseTexture
    • Optional location: number
    • Optional forceLocation: boolean

    Returns number

bindVao

clear

  • clear(clearColor?: number): void
  • Parameters

    • Optional clearColor: number

    Returns void

clearRenderTexture

  • Parameters

    Returns WebGLRenderer

createVao

destroy

  • destroy(removeView?: boolean): void
  • Parameters

    • Optional removeView: boolean

    Returns void

destroyPlugins

  • destroyPlugins(): void
  • Returns void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Calls each of the listeners registered for a given event.

    Parameters

    • event: string | symbol

      The event name.

    • Rest ...args: any[]

      Arguments that are passed to registered listeners

    Returns boolean

    true if the event had listeners, else false.

eventNames

  • eventNames(): Array<string | symbol>
  • Return an array listing the events for which the emitter has registered listeners.

    Returns Array<string | symbol>

flush

  • flush(): void
  • Returns void

generateTexture

initPlugins

  • initPlugins(): void
  • Returns void

listeners

  • listeners(event: string | symbol): Function[]
  • listeners(event: string | symbol, exists: boolean): boolean
  • Return the listeners registered for a given event.

    Parameters

    • event: string | symbol

      The event name.

    Returns Function[]

  • Check if there listeners for a given event. If exists argument is not true lists listeners.

    Parameters

    • event: string | symbol

      The event name.

    • exists: boolean

      Only check if there are listeners.

    Returns boolean

off

  • off(event: "prerender" | "postrender", fn?: function, context?: any): this
  • off(event: "context", fn?: function, context?: any): this
  • Parameters

    • event: "prerender" | "postrender"
    • Optional fn: function
        • (): void
        • Returns void

    • Optional context: any

    Returns this

  • Parameters

    • event: "context"
    • Optional fn: function
        • (gl: WebGLRenderingContext): void
        • Parameters

          • gl: WebGLRenderingContext

          Returns void

    • Optional context: any

    Returns this

on

  • on(event: "prerender" | "postrender", fn: function, context?: any): this
  • on(event: "context", fn: function, context?: any): this
  • Parameters

    • event: "prerender" | "postrender"
    • fn: function
        • (): void
        • Returns void

    • Optional context: any

    Returns this

  • Parameters

    • event: "context"
    • fn: function
        • (gl: WebGLRenderingContext): void
        • Parameters

          • gl: WebGLRenderingContext

          Returns void

    • Optional context: any

    Returns this

once

  • once(event: "prerender" | "postrender", fn: function, context?: any): this
  • once(event: "context", fn: function, context?: any): this
  • Parameters

    • event: "prerender" | "postrender"
    • fn: function
        • (): void
        • Returns void

    • Optional context: any

    Returns this

  • Parameters

    • event: "context"
    • fn: function
        • (gl: WebGLRenderingContext): void
        • Parameters

          • gl: WebGLRenderingContext

          Returns void

    • Optional context: any

    Returns this

removeAllListeners

  • removeAllListeners(event: "prerender" | "postrender" | "context"): this
  • Parameters

    • event: "prerender" | "postrender" | "context"

    Returns this

removeListener

  • removeListener(event: "prerender" | "postrender", fn?: function, context?: any): this
  • removeListener(event: "context", fn?: function, context?: any): this
  • Parameters

    • event: "prerender" | "postrender"
    • Optional fn: function
        • (): void
        • Returns void

    • Optional context: any

    Returns this

  • Parameters

    • event: "context"
    • Optional fn: function
        • (gl: WebGLRenderingContext): void
        • Parameters

          • gl: WebGLRenderingContext

          Returns void

    • Optional context: any

    Returns this

render

reset

  • Returns WebGLRenderer

resize

  • resize(screenWidth: number, screenHeight: number): void
  • Parameters

    • screenWidth: number
    • screenHeight: number

    Returns void

setBlendMode

  • setBlendMode(blendMode: number): void
  • Parameters

    • blendMode: number

    Returns void

setMaxListeners

  • setMaxListeners(): this
  • This function doesn't apply anymore.

    deprecated

    Returns this

setObjectRenderer

  • Parameters

    Returns void

setTransform

  • setTransform(matrix: Matrix): void
  • Parameters

    Returns void

unbindTexture

Static registerPlugin

  • registerPlugin(pluginName: string, ctor: Function): void
  • Parameters

    • pluginName: string
    • ctor: Function

    Returns void

Generated using TypeDoc