2021-08-19 17:51:41 +00:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
func _ready():
|
2021-09-26 06:15:01 +00:00
|
|
|
# Bind signals
|
|
|
|
$Button.button_up.connect($Example.emit_custom_signal.bind("Button", 42))
|
|
|
|
|
2021-08-19 17:51:41 +00:00
|
|
|
# Call methods.
|
|
|
|
$Example.simple_func()
|
|
|
|
($Example as Example).simple_const_func() # Force use of ptrcall
|
|
|
|
prints("returned", $Example.return_something("some string"))
|
|
|
|
prints("returned const", $Example.return_something_const())
|
2021-09-24 15:11:50 +00:00
|
|
|
prints("returned ref", $Example.return_extended_ref())
|
2021-09-28 13:49:53 +00:00
|
|
|
var ref = ExampleRef.new()
|
|
|
|
prints("sending ref: ", ref.get_instance_id(), "returned ref: ", $Example.extended_ref_checks(ref).get_instance_id())
|
2021-08-19 17:51:41 +00:00
|
|
|
prints("vararg args", $Example.varargs_func("some", "arguments", "to", "test"))
|
2021-09-16 07:21:40 +00:00
|
|
|
prints("test array", $Example.test_array())
|
2021-08-19 17:51:41 +00:00
|
|
|
|
|
|
|
# Use properties.
|
2021-09-15 03:56:20 +00:00
|
|
|
prints("custom position is", $Example.group_subgroup_custom_position)
|
|
|
|
$Example.group_subgroup_custom_position = Vector2(50, 50)
|
|
|
|
prints("custom position now is", $Example.group_subgroup_custom_position)
|
2021-08-19 17:51:41 +00:00
|
|
|
|
|
|
|
# Get constants
|
|
|
|
prints("FIRST", $Example.FIRST)
|
|
|
|
prints("ANSWER_TO_EVERYTHING", $Example.ANSWER_TO_EVERYTHING)
|
|
|
|
prints("CONSTANT_WITHOUT_ENUM", $Example.CONSTANT_WITHOUT_ENUM)
|
|
|
|
|
2021-09-26 06:15:01 +00:00
|
|
|
func _on_Example_custom_signal(name, value):
|
2021-08-19 17:51:41 +00:00
|
|
|
prints("Example emitted:", name, value)
|