Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CanvasRenderer

Hierarchy

Index

Constructors

constructor

Properties

Protected _backgroundColor

_backgroundColor: number

Protected _backgroundColorRgba

_backgroundColorRgba: number[]

Protected _backgroundColorString

_backgroundColorString: string

Protected _lastObjectRendered

_lastObjectRendered: DisplayObject

Protected _tempDisplayObjectParent

_tempDisplayObjectParent: Container

autoResize

autoResize: boolean

blendModes

blendModes: any

clearBeforeRender

clearBeforeRender: boolean

context

context: CanvasRenderingContext2D | null

extract

extract: CanvasExtract

height

height: number

Optional interaction

interaction: InteractionManager

maskManager

maskManager: CanvasMaskManager

options

plugins

plugins: any

preserveDrawingBuffer

preserveDrawingBuffer: boolean

refresh

refresh: boolean

resolution

resolution: number

rootContext

rootContext: CanvasRenderingContext2D

Optional rootResolution

rootResolution: number

roundPixels

roundPixels: boolean

screen

screen: Rectangle

smoothProperty

smoothProperty: string

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

addListener

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

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

    • Optional context: any

    Returns this

clear

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

    • Optional clearColor: string

    Returns void

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>

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
  • Parameters

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

    • Optional context: any

    Returns this

on

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

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

    • Optional context: any

    Returns this

once

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

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

    • Optional context: any

    Returns this

removeAllListeners

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

    • event: "prerender" | "postrender"

    Returns this

removeListener

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

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

    • Optional context: any

    Returns this

render

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

Static registerPlugin

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

    • pluginName: string
    • ctor: Function

    Returns void

Generated using TypeDoc