miggor-StreamGraph/classes/deck/nodes/print.gd
2023-06-12 18:59:30 +03:00

34 lines
638 B
GDScript

extends DeckNode
func _init() -> void:
add_input_port(
Deck.Types.STRING,
"Text to print",
"field"
)
add_input_port(
Deck.Types.BOOL,
"Trigger",
"button"
)
add_output_port(
Deck.Types.BOOL,
"On Trigger",
"label"
)
name = "Print"
func _receive(to_port: int, data: DeckType, extra_data: Array = []) -> void:
if to_port != 1:
return
var data_to_print = ports[0].value_callback.call() if ports[0].value_callback.call() != "" else data.get_value()
# var data_to_print = input_ports[0].value_callback.call()
print(data_to_print)
print("extra data: ", extra_data)
send(2, DeckType.DeckTypeBool.new(true))