Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: DialogueGraph

[16:7] extends: FxObj

Wraps FXGL's DialogueGraph (com.almasb.fxgl.cutscene.dialogue.DialogueGraph), a minimally- checked node + edge container that drives a dialogue scene. Nodes are stored in an observable Map keyed by an internally- tracked unique id; edges are stored in an observable List. The graph also tracks the start-node id, which the dialogue scene enters first.

Methods

  • DialogueGraph (int UniqueID = 0)

    Creates a new empty DialogueGraph.

    • @p UniqueID is the initial value of the node-id counter (default 0).
  • adopt (object Ajo)

    Wraps an existing DialogueGraph AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a DialogueGraph.
    • @r A new wrapper.
  • addNode (object NodeObj)

    Adds a DialogueNode to this graph, allocating its id from the internal counter.

    • @p NodeObj is a DialogueNode (or subclass) wrapper.
    • @r this object
  • removeNode (object NodeObj)

    Removes the given node from this graph (and any incident edges).

    • @p NodeObj is a DialogueNode (or subclass) wrapper.
    • @r this object
  • addEdge (object SourceObj, object TargetObj, int OptionID = 0)

    Adds an edge from Source to Target with the given option id (defaults to 0).

    • @p SourceObj is a DialogueNode wrapper.
    • @p TargetObj is a DialogueNode wrapper.
    • @p OptionID is the source option id (default 0).
    • @r this object
  • addEdgeObj (object EdgeObj)

    Adds a pre-built DialogueEdge to this graph.

    • @p EdgeObj is a DialogueEdge wrapper.
    • @r this object
  • removeEdge (object SourceObj, object TargetObj)

    Removes the edge between Source and Target (any option id).

    • @p SourceObj is a DialogueNode wrapper.
    • @p TargetObj is a DialogueNode wrapper.
    • @r this object
  • removeEdgeObj (object EdgeObj)

    Removes a specific DialogueEdge from this graph.

    • @p EdgeObj is a DialogueEdge wrapper.
    • @r this object
  • removeChoiceEdge (object SourceObj, int OptionID, object TargetObj)

    Removes the choice-edge from Source to Target using OptionID.

    • @p SourceObj is a DialogueNode wrapper.
    • @p OptionID is the option id.
    • @p TargetObj is a DialogueNode wrapper.
    • @r this object
  • containsNode (object NodeObj)

    Returns whether the graph contains the given node.

    • @p NodeObj is a DialogueNode wrapper.
    • @r A bool.
  • findNodeID (object NodeObj)

    Returns the id of the node in this graph, or -1 if absent.

    • @p NodeObj is a DialogueNode wrapper.
    • @r An int.
  • getNodeByID (int Id)

    Returns the node with the given id. Throws if no such node exists.

    • @p Id is the node id.
    • @r An AussomJavaObject around a DialogueNode.
  • getStartNodeID ()

    Returns the start-node id.

    • @r An int.
  • setStartNodeID (int Id)

    Sets the start-node id.

    • @p Id is the new start-node id.
    • @r this object
  • getStartNode ()

    Returns the start node (looked up by id).

    • @r An AussomJavaObject around a DialogueNode.
  • startNodeIDProperty ()

    Returns the IntegerProperty backing the start-node id.

    • @r An AussomJavaObject around an IntegerProperty.
  • nextNode (object NodeObj)

    Returns the next node reachable from Node along any edge, or null if none exists.

    • @p NodeObj is a DialogueNode wrapper.
    • @r An AussomJavaObject around a DialogueNode, or null.
  • nextNodeByOption (object NodeObj, int OptionID)

    Returns the next node reachable from Node along the edge with the given OptionID, or null if none exists.

    • @p NodeObj is a DialogueNode wrapper.
    • @p OptionID is the option id.
    • @r An AussomJavaObject around a DialogueNode, or null.
  • getNodes ()

    Returns the underlying observable Map<Int, DialogueNode>.

    • @r An AussomJavaObject around an ObservableMap.
  • getEdges ()

    Returns the underlying observable List.

    • @r An AussomJavaObject around an ObservableList.
  • copy ()

    Returns a shallow copy of this graph (same node and edge references).

    • @r A new DialogueGraph wrapper.