Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: QuestService

[15:7] extends: EngineService

Wraps FXGL's QuestService, the engine service that holds the active quest list and drives objective updates each frame. Reached at runtime via fxgl.getQuestService; obtain a wrapper via adopt.

Methods

  • QuestService (Ajo = null)

    Creates a QuestService wrapper. Empty by default; the (Ajo) form wraps an existing instance from fxgl.getQuestService.

    • @p Ajo is an optional AussomJavaObject around a QuestService.
  • adopt (object Ajo)

    Wraps an existing QuestService AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a QuestService.
    • @r A new wrapper.
  • newQuest (string Name, VarsMap = null)

    Creates a new quest bound to the world properties of the running game (or to the supplied PropertyMap). Note that newQuest only constructs the Quest -- it does NOT register it for tracking. Call startQuest to begin objective updates.

    • @p Name is the quest name.
    • @p VarsMap is an optional PropertyMap wrapper. When null, FXGL uses the world's property map.
    • @r A Quest wrapper.
  • startQuest (object QuestObj)

    Starts the given quest and adds it to the tracked list. Without this call, objectives never bind to world-property changes and the quest never progresses.

    • @p QuestObj is a Quest wrapper.
    • @r this object
  • stopQuest (object QuestObj)

    Stops the given quest and removes it from the tracked list.

    • @p QuestObj is a Quest wrapper.
    • @r this object
  • stopAllQuests ()

    Stops every tracked quest.

    • @r this object
  • getQuests ()

    Returns the unmodifiable observable list of currently tracked quests as a list of Quest wrappers.

    • @r A list of Quest wrappers.
  • questsProperty ()

    Returns the raw observable list of tracked quests as an AussomJavaObject. Useful when you need to bind the list to a JavaFX ListView; for simple iteration prefer getQuests.

    • @r An AussomJavaObject around an ObservableList.