Hierarchy (view full)

Constructors

Properties

Reference to the BaseTexture used by this texture.

clipH: number

The height of the clipped region.

clipW: number

The width of the clipped region.

clipX: number

The x-coordinate of the top-left corner of the clipped region.

clipY: number

The y-coordinate of the top-left corner of the clipped region.

height: number

The height of the texture.

scale: number = ...

Image scaling factor

text: string
width: number

The width of the texture.

Methods

  • Sets the region of the texture to be used for rendering.

    Parameters

    • x: number

      The x-coordinate of the top-left corner of the region.

    • y: number

      The y-coordinate of the top-left corner of the region.

    • w: number

      The width of the region.

    • h: number

      The height of the region.

    Returns void

  • Update the displayed text

    Parameters

    • text: string

    Returns void

  • Creates a new Texture instance from the specified image source.

    Parameters

    • rapid: Rapid

      The Rapid instance to use.

    • image: Images

      The image source to create the texture from.

    • antialias: boolean = false

      Whether to enable antialiasing for the texture. Default is false.

    Returns Texture

    A new Texture instance created from the image source.

  • Creates a new Texture instance from the specified URL.

    Parameters

    • rapid: Rapid

      The Rapid instance to use.

    • url: string

      The URL of the image to create the texture from.

    Returns Promise<Texture>

    A new Texture instance created from the specified URL.