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 :)
Name | Type | Description |
---|---|---|
game | PhaserGame | A reference to the Phaser Game instance |
Whether the render view should be resized automatically
Manages the blendModes
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.
Manages the filters
The height of the canvas view
Manages the masks using the stencil buffer
The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.
The resolution of the renderer
Deals with managing the shader programs and their attribs
Manages the rendering of sprites
Manages the stencil buffer
Whether the render view is transparent
The canvas element that everything is drawn to
The width of the canvas view
Removes everything from the renderer (event listeners, spritebatch, etc...)
Maps Pixi blend modes to WebGL blend modes.
Renders the stage to its webGL view
Name | Type | Description |
---|---|---|
stage | Stage | the Stage element to be rendered |
Renders a Display Object.
Name | Type | Description |
---|---|---|
displayObject | DisplayObject | The DisplayObject to render |
projection | Point | The projection |
buffer | Array | a standard WebGL buffer |
Resizes the webGL view to the specified width and height.
Name | Type | Description |
---|---|---|
width | Number | the new width of the webGL view |
height | Number | the new height of the webGL view |
Updates and Creates a WebGL texture for the renderers context.
Name | Type | Description |
---|---|---|
texture | PIXI.Texture | the texture to update |
True if the texture was successfully bound, otherwise false.
© 2016 Richard Davey, Photon Storm Ltd.
Licensed under the MIT License.
http://phaser.io/docs/2.6.2/PIXI.WebGLRenderer.html