Class Texture

Class representing texture that can be animated.

Represents deprecated render type, should be performed in texture packs.

Constructors

Methods

  • Returns {
        h: number;
        w: number;
    }

    Texture resolution after recalculating it with pixel scale.

    • h: number
    • w: number
  • Parameters

    • token: number

    Returns string

    Current animation frame.

  • Resets animation.

    Parameters

    • token: number

    Returns Texture

    Reference to itself to be used in sequential calls.

  • 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.

  • 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.

  • Sets texture file path.

    Parameters

    • path: string

    Returns Texture

    Reference to itself to be used in sequential calls.

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