API Docs for: 2.0.0
Show:

WebGLSpriteBatch Class

Constructor

WebGLSpriteBatch

() private

Methods

_CompileShader

(
  • gl
  • shaderSrc
  • shaderType
)
Any private static

Parameters:

  • gl WebGLContext

    the current WebGL drawing context

  • shaderSrc Array
  • shaderType Number

Returns:

Any:

begin

(
  • renderSession
)

Parameters:

  • renderSession Object

    The RenderSession object

CompileFragmentShader

(
  • gl
  • shaderSrc
)
Any static

Parameters:

  • gl WebGLContext

    the current WebGL drawing context

  • shaderSrc Array

Returns:

Any:

compileProgram

(
  • gl
  • vertexSrc
  • fragmentSrc
)
Any static

Parameters:

  • gl WebGLContext

    the current WebGL drawing context

  • vertexSrc Array
  • fragmentSrc Array

Returns:

Any:

CompileVertexShader

(
  • gl
  • shaderSrc
)
Any static

Parameters:

  • gl WebGLContext

    the current WebGL drawing context

  • shaderSrc Array

Returns:

Any:

destroy

()

Destroys the SpriteBatch.

flush

()

Renders the content and empties the current batch.

initDefaultShaders

() private static

render

(
  • sprite
)

Parameters:

  • sprite Sprite

    the sprite to render when using this spritebatch

renderBatch

(
  • texture
  • size
  • startIndex
)

Parameters:

  • texture Texture
  • size Number
  • startIndex Number

renderTilingSprite

(
  • sprite
)

Renders a TilingSprite using the spriteBatch.

Parameters:

setContext

(
  • gl
)

Parameters:

  • gl WebGLContext

    the current WebGL drawing context

Properties

currentBatchSize

Number

indices

Uint16Array

Holds the indices

size

Number

The number of images in the SpriteBatch before it flushes

vertices

Float32Array

Holds the vertices