Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SpriteBatch

Hierarchy

  • SpriteBatch

Index

Constructors

constructor

  • new SpriteBatch(gl: WebGLRenderingContext, maxSprites: number): SpriteBatch
  • Parameters

    • gl: WebGLRenderingContext
    • maxSprites: number

    Returns SpriteBatch

Properties

capacity

capacity: number

inverseSpriteTextureSize

inverseSpriteTextureSize: Vec2

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

end

  • end(): void
  • Returns void

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

Generated using TypeDoc