Skip to main content
Typo
Source Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

One way is to pass self into the DilogueSessionDialogueSession._init(), like so:

@onready var my_label = $MarginContainer/Panel/Label func display_text(text: String): my_label.set_text(text) func create_dialogue_session(): return DialogueSession.new(self) class DialogueSession: var container_class _init(c_c): container_class = c_c func show_next(): container_class.display_text("the next number is:" + num++) 

I do not believe this is likely to be the best way

One way is to pass self into the DilogueSession._init(), like so:

@onready var my_label = $MarginContainer/Panel/Label func display_text(text: String): my_label.set_text(text) func create_dialogue_session(): return DialogueSession.new(self) class DialogueSession: var container_class _init(c_c): container_class = c_c func show_next(): container_class.display_text("the next number is:" + num++) 

I do not believe this is likely to be the best way

One way is to pass self into the DialogueSession._init(), like so:

@onready var my_label = $MarginContainer/Panel/Label func display_text(text: String): my_label.set_text(text) func create_dialogue_session(): return DialogueSession.new(self) class DialogueSession: var container_class _init(c_c): container_class = c_c func show_next(): container_class.display_text("the next number is:" + num++) 

I do not believe this is likely to be the best way

Source Link
Seph Reed
  • 275
  • 4
  • 10

One way is to pass self into the DilogueSession._init(), like so:

@onready var my_label = $MarginContainer/Panel/Label func display_text(text: String): my_label.set_text(text) func create_dialogue_session(): return DialogueSession.new(self) class DialogueSession: var container_class _init(c_c): container_class = c_c func show_next(): container_class.display_text("the next number is:" + num++) 

I do not believe this is likely to be the best way