Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Mefihl | |
Old Version | Published before Godot 3 was released. |
How create “Custom node” with code in gdscript? Example show text put on custom node input.
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Mefihl | |
Old Version | Published before Godot 3 was released. |
How create “Custom node” with code in gdscript? Example show text put on custom node input.
Reply From: | avencherus |
If you’re talking about creating existing nodes in code, you can do something like this:
var my_label_node = Label.new()
add_child(my_label_node)
my_label_node.set_owner(self)
my_label_node.set_text('Text')
my_label_node.set_global_pos(Vector2(50,50))
I’m using a Label node in my example here, and it executes in the ready() of the scene’s rood node, adding a Label node to itself.
If you’re talking about creating your own node types, I may be wrong, but I don’t think gdscript supports that yet. Though you can still create your own nodes using plug-ins.
No, create custom node for visual scripting.
Mefihl | 2016-08-29 15:11