Visual Scripting - How create "Custom node" with code in gdscript?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Mefihl
:warning: Old Version Published before Godot 3 was released.

How create “Custom node” with code in gdscript? Example show text put on custom node input.

:bust_in_silhouette: 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