PIXI. WebGLRenderer

new WebGLRenderer(width, height, options)

The WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer should be used for browsers that support webGL. This Render works by automatically managing webGLBatchs. So no need for Sprite Batches or Sprite Clouds. Don't forget to add the view to your DOM or you will not see anything :)

Parameters:
Name Type Argument Default Description
width Number <optional>
0

the width of the canvas view

height Number <optional>
0

the height of the canvas view

options Object <optional>

The optional renderer parameters

Source - pixi/renderers/webgl/WebGLRenderer.js, line 8

Members

autoResize :Boolean

Whether the render view should be resized automatically

Source - pixi/renderers/webgl/WebGLRenderer.js, line 71

blendModeManager :PIXI.WebGLBlendModeManager

Manages the blendModes

Source - pixi/renderers/webgl/WebGLRenderer.js, line 204

clearBeforeRender :Boolean

This sets if the WebGLRenderer will clear the context texture or not before the new render pass. If true: If the Stage is NOT transparent, Pixi will clear to alpha (0, 0, 0, 0). If the Stage is transparent, Pixi will clear to the target Stage's background color. Disable this by setting this to false. For example: if your game has a canvas filling background image, you often don't need this set.

Source - pixi/renderers/webgl/WebGLRenderer.js, line 87

contextLostBound :function

Source - pixi/renderers/webgl/WebGLRenderer.js, line 127

contextRestoredBound :function

Source - pixi/renderers/webgl/WebGLRenderer.js, line 133

filterManager :PIXI.WebGLFilterManager

Manages the filters

Source - pixi/renderers/webgl/WebGLRenderer.js, line 190

height :Number

The height of the canvas view

Default Value:
  • 600
Source - pixi/renderers/webgl/WebGLRenderer.js, line 108

maskManager :PIXI.WebGLMaskManager

Manages the masks using the stencil buffer

Source - pixi/renderers/webgl/WebGLRenderer.js, line 183

offset :PIXI.Point

Source - pixi/renderers/webgl/WebGLRenderer.js, line 161

preserveDrawingBuffer :Boolean

The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.

Source - pixi/renderers/webgl/WebGLRenderer.js, line 79

projection :PIXI.Point

Source - pixi/renderers/webgl/WebGLRenderer.js, line 155

renderSession :Object

TODO remove

Source - pixi/renderers/webgl/WebGLRenderer.js, line 211

resolution :Number

The resolution of the renderer

Default Value:
  • 1
Source - pixi/renderers/webgl/WebGLRenderer.js, line 52

shaderManager :PIXI.WebGLShaderManager

Deals with managing the shader programs and their attribs

Source - pixi/renderers/webgl/WebGLRenderer.js, line 169

spriteBatch :PIXI.WebGLSpriteBatch

Manages the rendering of sprites

Source - pixi/renderers/webgl/WebGLRenderer.js, line 176

stencilManager :PIXI.WebGLStencilManager

Manages the stencil buffer

Source - pixi/renderers/webgl/WebGLRenderer.js, line 197

transparent :Boolean

Whether the render view is transparent

Source - pixi/renderers/webgl/WebGLRenderer.js, line 63

type :Number

Source - pixi/renderers/webgl/WebGLRenderer.js, line 46

view :HTMLCanvasElement

The canvas element that everything is drawn to

Source - pixi/renderers/webgl/WebGLRenderer.js, line 117

width :Number

The width of the canvas view

Default Value:
  • 800
Source - pixi/renderers/webgl/WebGLRenderer.js, line 99

Methods

destroy()

Removes everything from the renderer (event listeners, spritebatch, etc...)

Source - pixi/renderers/webgl/WebGLRenderer.js, line 477

initContext()

Source - pixi/renderers/webgl/WebGLRenderer.js, line 238

mapBlendModes()

Maps Pixi blend modes to WebGL blend modes.

Source - pixi/renderers/webgl/WebGLRenderer.js, line 508

render(stage)

Renders the stage to its webGL view

Parameters:
Name Type Description
stage PIXI.Stage

the Stage element to be rendered

Source - pixi/renderers/webgl/WebGLRenderer.js, line 276

renderDisplayObject(displayObject, projection, buffer)

Renders a Display Object.

Parameters:
Name Type Description
displayObject PIXI.DisplayObject

The DisplayObject to render

projection PIXI.Point

The projection

buffer Array

a standard WebGL buffer

Source - pixi/renderers/webgl/WebGLRenderer.js, line 344

resize(width, height)

Resizes the webGL view to the specified width and height.

Parameters:
Name Type Description
width Number

the new width of the webGL view

height Number

the new height of the webGL view

Source - pixi/renderers/webgl/WebGLRenderer.js, line 378

updateTexture(texture)

Updates and Creates a WebGL texture for the renderers context.

Parameters:
Name Type Description
texture PIXI.Texture

the texture to update

Source - pixi/renderers/webgl/WebGLRenderer.js, line 404
Phaser Copyright © 2012-2014 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Tue Nov 25 2014 00:18:28 GMT-0000 (GMT) using the DocStrap template.