Class representing static or animated texture.

Constructors

Methods

  • Parameters

    • canvas: Canvas
    • x: number
    • y: number
    • scale: number

    Returns void

  • Parameters

    • canvas: Canvas
    • cutout: RectF
    • x: number
    • y: number
    • scale: number

    Returns void

  • Resizes all the frames to match the first one.

    Returns void

  • Parameters

    • frame: number

      frame number

    Returns Bitmap

    Bitmap object containing animation frame for the corresponding frame number.

  • Returns number

    Frame number of the animation corresponding to current system time.

  • Returns number

    Height of the texture in pixels.

  • Returns number

    Width of the texture in pixels.

  • Sets texture offsets in pixels from the upper left bound of the bitmap.

    Parameters

    • obj: {
          x?: number;
          y?: number;
      }
      • Optionalx?: number
      • Optionaly?: number

    Returns void

  • Releases all allocated resources, should be called when the texture is not longer needed.

    Returns void

  • Resizes all the frames by constant scale multiplier.

    Parameters

    • scale: number

      scale to modify the frames by

    Returns void

  • Resizes all the frames of the texture to the specified size.

    Parameters

    • width: number
    • height: number

    Returns void

Properties

animation: IBitmapWrap[]
bitmap: IBitmapWrap
delay: number
isAnimation: boolean

Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.