Skip to content

Minimal Theatre Setup

This article cover the basic minimal setup for Theatre, like the one created in the Quick Start article, but a lot more shorter and straightforward.


  1. Create a new 2D or User Interface scene, and structure it like the following:

    • Scene tree

    The two highlighted nodes are the Theatre-specific nodes.

    Adjust the size and position of the PanelContainer to your liking.


  2. Tick the fit_content property on the DialogueLabel.

    • fit_content property


  3. Attach a script to the scene and create a new Stage variable with @export.

    extends Control
    
    @export var stage : Stage
    


  4. Go to the inspector, and assign the Stage node to stage.


  5. Click the Stage node, go to the inspector, and assign the Label to actor_label, and DialogueLabel to dialogue_label.

    • Label and DialogueLabel node assigned on the Stage inspector


  6. Use input event to progress the Stage.

    extends Control
    
    @export var stage : Stage
    
    func _input(event):
        if event.is_action_pressed("ui_accept"):
            stage.progress()
    


  7. You can then write/load your Dialogue, and start it.

    extends Control
    
    var dlg : Dialogue # Load/create Dialogue here
    
    @export var stage : Stage
    
    func _input(event):
        if event.is_action_pressed("ui_accept"):
            stage.progress()
    
    func _ready():
        stage.start(dlg)
    


Code summary

MyScene
  ├─ Stage
  └─ PanelContainer
        └─ VBoxContainer
            ├─ Label
            └─ DialogueLabel
extends Control

var dlg : Dialogue # Load/create Dialogue here

@export var stage : Stage

func _input(event):
    if event.is_action_pressed("ui_accept"):
        stage.progress()

func _ready():
    stage.start(dlg)


Download

Download scene & script

Got any questions? feel free to ask them in the GitHub Discussions!