Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: CutsceneService

[18:7] extends: EngineService

Wraps FXGL's CutsceneService (com.almasb.fxgl.cutscene.CutsceneService), the engine service that plays back text cutscenes, dialogue graphs, and video cutscenes inside the running game. Reach it at runtime via fxgl.getCutsceneService(). The service is constructed and registered by FXGL; this wrapper is an adopt-only facade. The startXxx methods push a SubScene onto the SceneService so the cutscene takes over input while it runs.

Methods

  • CutsceneService (Ajo = null)

    Creates a CutsceneService wrapper. Empty by default; use adopt to wrap the running engine's instance.

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

    Wraps an existing CutsceneService AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a CutsceneService.
    • @r A new wrapper.
  • startCutscene (object CutsceneObj, callback OnFinished = null)

    Starts the given Cutscene, optionally calling OnFinished when the cutscene closes.

    • @p CutsceneObj is a Cutscene wrapper.
    • @p OnFinished is a callback () -> void, or null.
    • @r this object
  • startDialogueScene (object GraphObj, callback OnFinished = null)

    Starts a dialogue graph using a fresh empty context, the empty function-call handler, and an optional OnFinished callback. Use startDialogueSceneFull for custom context and function handler.

    • @p GraphObj is a DialogueGraph wrapper.
    • @p OnFinished is a callback () -> void, or null.
    • @r this object
  • startDialogueSceneFull (object GraphObj, object ContextMapObj, object HandlerObj, callback OnFinished = null)

    Starts a dialogue graph with full control: caller supplies the dialogue context (a PropertyMap), the FunctionCallHandler for $func() calls inside the graph, and an OnFinished callback.

    • @p GraphObj is a DialogueGraph wrapper.
    • @p ContextMapObj is an AussomJavaObject around a PropertyMap.
    • @p HandlerObj is a FunctionCallHandler wrapper.
    • @p OnFinished is a callback () -> void, or null.
    • @r this object
  • startVideoCutscene (object MediaViewObj, callback OnFinished = null)

    Starts a video cutscene from a JavaFX MediaView Node.

    • @p MediaViewObj is an AussomJavaObject around a MediaView.
    • @p OnFinished is a callback () -> void, or null.
    • @r this object
  • getDialogueScene ()

    Returns the underlying DialogueScene SubScene as an AussomJavaObject.

    • @r An AussomJavaObject around a DialogueScene.