dino-ge
    Preparing search index...

    Class default

    Represents text that can be drawn to the screen and interact with input.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    fontSize: number

    Font size in pixels.

    id: string = ...

    Unique identifier for the game object.

    length: number

    Number of characters in the text string.

    onClick: () => void = ...

    Callback function for click events. Only triggered if the object is registered.

    register: boolean = true

    Whether the object should be automatically registered with the engine.

    registered: boolean = false

    Whether the object is currently registered with the engine.

    _registry: typeof default = Registry

    Static helper for tests to bypass Registry circularity if mocked.

    Accessors

    Methods

    • Emits a custom event on this object's event bus.

      Parameters

      • type: string

        The event type.

      • Optionaldetail: unknown

        Optional data to pass with the event.

      Returns void

    • Stops listening for an event on this object's event bus.

      Parameters

      • type: string

        The event type.

      • callback: (event: CustomEvent) => void

        The function to remove.

      Returns void

    • Listens for an event on this object's event bus.

      Parameters

      • type: string

        The event type.

      • callback: (event: CustomEvent) => void

        The function to run when the event occurs.

      Returns void