IdaJS
    Preparing search index...

    Interface TextApi

    The global text object API to provide the custom dialogs in IdaJS mod.

    interface TextApi {
        Colors: DialogColors;
        Flags: TextFlags;
        create(textEntity?: UserText | UserTextFunction): number;
        createChoices(): number[];
        replace(textId: number, textEntity: UserText | UserTextFunction): number;
        restore(textId: number): number;
        update(textId: number, textEntity: UserText | UserTextFunction): number;
        _reset(): void;
    }
    Index

    Properties

    Colors: DialogColors

    The string => number "enum", containing Dialog colors.

    Flags: TextFlags

    Flags for dialog text display.

    Methods

    • Register a new text entity and return its text ID.

      Parameters

      Returns number

      The new text ID, that can be used in text zones or scripts.

      NB. If you want to use custom text in the life handlers, you should create just one text entity Id in the SceneEvents.afterLoadScene event, using this create function, store its Id to a variable, and then reuse it, by calling text.update function.

    • A helper function that creates 10 text entities and returns their IDs in an array. This is useful for implementing dialog choices, where you need to have multiple text entities on the screen.

      Returns number[]

      An array of text IDs, that can be used in the dialog choices life calls.

    • Replace an existing LBA game text entity by IdaJS controlled text.

      Leave the text empty to use the original game text, but change other parameters.

      If you also specify a custom text, you must specify the flags as well, or they will be set to default.

      Parameters

      • textId: number

        The text ID of the original game. See original game life scripts to see which text IDs are used in which situations, or read the Text.hqr file in an HQR editor.

      • textEntity: UserText | UserTextFunction

        The text entity content to replace the original game text with.

      Returns number

      The text ID

    • Restore a game text entity to its original state.

      Parameters

      • textId: number

        The text ID

      Returns number

      The text ID

    • Update a registered text entity by its text ID.

      Use this in the life handlers. Create a dedicated text entity for life scripts once with text.create in the SceneEvents.afterLoadScene event, and then update its content dynamically in the life scripts with this function, each time you need to display some dialog.

      Parameters

      Returns number

      The text ID.

    • Private

      Reset all the text data.

      Returns void

      This is an internal method. Only call it if you know what you are doing.