Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SpriteBatch

Hierarchy

  • SpriteBatch

Implements

Index

Constructors

constructor

  • new SpriteBatch(gl: WebGL2RenderingContext, maxSprites: number, depthOffset?: number, yOffset?: number): SpriteBatch
  • Parameters

    • gl: WebGL2RenderingContext
    • maxSprites: number
    • Default value depthOffset: number = 0
    • Default value yOffset: number = 0

    Returns SpriteBatch

Properties

capacity

capacity: number

inverseSpriteTextureSize

inverseSpriteTextureSize: Vector2

texSprites

texSprites: WebGLTexture

Methods

add

  • add(tileX: number, tileY: number, spriteSize: number, sourceX: number, sourceY: number, sourceSize: number, offsetX?: number, offsetY?: number, red?: number, green?: number, blue?: number, alpha?: number): void
  • Parameters

    • tileX: number
    • tileY: number
    • spriteSize: number
    • sourceX: number
    • sourceY: number
    • sourceSize: number
    • Default value offsetX: number = 0
    • Default value offsetY: number = 0
    • Default value red: number = 255
    • Default value green: number = 255
    • Default value blue: number = 255
    • Default value alpha: number = 255

    Returns void

begin

  • begin(): void
  • Returns void

clear

  • clear(): void
  • Returns void

dispose

  • dispose(): void
  • Returns void

end

  • end(): number
  • Returns number

render

  • render(x: number, y: number, tileScale: number, viewportWidth: number, viewportHeight: number): void
  • Parameters

    • x: number
    • y: number
    • tileScale: number
    • viewportWidth: number
    • viewportHeight: number

    Returns void

setup

  • setup(): void
  • Returns void

Static createShaders

  • createShaders(gl: WebGL2RenderingContext): void
  • Parameters

    • gl: WebGL2RenderingContext

    Returns void

Static linkShaders

  • Returns Promise<void>

Generated using TypeDoc