Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: TextNode

[15:7] extends: DialogueNode

Wraps FXGL's TextNode (com.almasb.fxgl.cutscene.dialogue.TextNode), a DialogueNode subclass that displays a line of text and offers the player a list of options. Every TextNode starts with one empty option (id 0) so the simplest chain ("just go to the next node") works with no setup.

Methods

  • TextNode (Text = null)

    Creates a new TextNode with the given text. Pass null for the adopt path.

    • @p Text is the line of text shown to the player.
  • adopt (object Ajo)

    Wraps an existing TextNode AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a TextNode.
    • @r A new wrapper.
  • addOption (string OptionText, string Condition = "")

    Adds a new option with the given text and (optional) condition string. Returns the new option's id.

    • @p OptionText is the option's display text.
    • @p Condition is an optional FXGL condition string (default "").
    • @r An int with the new option id.
  • removeOption (int Id)

    Removes the option with the given id and returns the removed Option wrapper. Remaining option ids are remapped to keep them contiguous.

    • @p Id is the option id to remove.
    • @r An AussomJavaObject around the removed Option.
  • getOptions ()

    Returns the underlying ObservableList

    • @r An AussomJavaObject around an ObservableList
  • getNumOptions ()

    Returns the option count.

    • @r An int.
  • getLastOptionID ()

    Returns the id of the last usable option (size - 1).

    • @r An int.
  • getHasUserOptions ()

    Returns whether at least one option has non-empty text.

    • @r A bool.
  • copy ()

    Returns a shallow copy of this TextNode.

    • @r A new TextNode wrapper.