WebGLRenderer Class
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 webGLBatch's. So no need for Sprite Batch's or Sprite Cloud's Dont forget to add the view to your DOM or you will not see anything :)
Constructor
WebGLRenderer
-
width=0
-
height=0
-
view
-
transparent=false
-
antialias=false
Parameters:
-
width=0
Numberthe width of the canvas view
-
height=0
Numberthe height of the canvas view
-
view
Canvasthe canvas to use as a view, optional
-
transparent=false
BooleanIf the render view is transparent, default false
-
antialias=false
Booleansets antialias (only applicable in chrome at the moment)
Item Index
Methods
Methods
destroyTexture
-
texture
Destroys a loaded webgl texture
Parameters:
-
texture
TextureThe texture to update
handleContextLost
-
event
Handles a lost webgl context
Parameters:
-
event
Event
handleContextRestored
-
event
Handles a restored webgl context
Parameters:
-
event
Event
render
-
stage
Renders the stage to its webGL view
Parameters:
-
stage
Stagethe Stage element to be rendered
resize
-
width
-
height
resizes the webGL view to the specified width and height
Parameters:
-
width
Numberthe new width of the webGL view
-
height
Numberthe new height of the webGL view
updateTextures
()
private
static
Updates the textures loaded into this webgl renderer