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

    • 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

    • Updates the displayed text. Re-renders the texture if the text has changed.

      Parameters

      • text: string

        The new text to display.

      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.