CRITICAL STEP IN ORDER FOR CUSTOM GUI ELEMENTS TO DISPLAY:<br><br>In order to make custom GUI CANVAS ELEMENT DERIVED CALSS in GODOT SCRIPT and not through the visual editor,<br>the critical step to do is .add_child() the CANVAS ITEM to a CONTROL PARENT<br><br>EXAMPLE:<br><br>#The function button() is written within the script of a control<br><br>
func button():
var button = Button.new()
button.set_text('hello')
return button<br><br>#Then, in the draw() function of the control, <br><br>func draw():<br>self.add_child(label())<br>
var image = ImageTexture.new()
image.load("res://HudTextures/Icons/Icon.png")
<br>var texture = draw_texture_rect(image,Rect2(Vector2(255,255),Vector2(255,255)),0,Color(1,1,1,1))<br>