rapid-render
    Preparing search index...

    Class Text

    Hierarchy (View Summary)

    Index

    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

    • Clone the current texture

      Returns Texture

      A new Texture instance with the same base texture reference.

    • Converts the current texture into a spritesheet.

      Parameters

      • spriteWidth: number

        The width of each sprite in the spritesheet.

      • spriteHeight: number

        The height of each sprite in the spritesheet.

      Returns Texture[]

      An array of Texture instances representing the sprites in the spritesheet.

    • 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 undefined | Text

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