Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Texture

Class representing texture that can be animated

deprecated

no longer supported and should not be used in new code

Hierarchy

  • Texture

Index

Constructors

constructor

  • new Texture(path: string): Texture

Methods

getResolution

  • getResolution(): { h: number; w: number }
  • Returns { h: number; w: number }

    texture resolution after recalculating it with pixel scale

    • h: number
    • w: number

getTexture

  • getTexture(token: number): string

resetAnimation

  • resetAnimation(token: number): Texture
  • Resets animation

    Parameters

    • token: number

    Returns Texture

    reference to itself to be used in sequential calls

setAnimation

  • setAnimation(animation: string[], delay: number): Texture
  • Makes texture animated

    Parameters

    • animation: string[]

      array of paths to the animation frames. Each frame should be stored in a separate file

    • delay: number

      specifies each frame delay in ticks

    Returns Texture

    reference to itself to be used in sequential calls

setPixelScale

  • setPixelScale(scale: number): Texture

setResolution

  • setResolution(w: number, h: number): Texture
  • Specifies texture resolution. If not equal to file dimensions, the image will be stretched to fit the resolution

    Parameters

    • w: number
    • h: number

    Returns Texture

    reference to itself to be used in sequential calls

setTexture

  • setTexture(path: string): Texture
  • Sets texture file path

    Parameters

    • path: string

    Returns Texture

    reference to itself to be used in sequential calls

Generated using TypeDoc