- Edited
so i have some code, i realized there's a button.icon property which changes the texture, but i can't find a way to set the image i want to it through code
extends Control
func _ready():
var button = Button.new()
button.text = "Click me"
button.icon = "res://yea.png"
doesn't show any errors while scripting but when i load the game it crashes and gives me the error
" Invalid set index 'icon' (on base: 'Button') with value of type 'String'. "