godot 4.
how to disable click acceptance for texture button?
in a regular button, this is button.disabled, how to do this with texture button?
I tried texture_button, texturebutton, its not work…
godot 4.
how to disable click acceptance for texture button?
in a regular button, this is button.disabled, how to do this with texture button?
I tried texture_button, texturebutton, its not work…
The TextureButton
inherits all properties from BaseButton
, so the it also has the disabled
property, that you can change in the same way as with regular buttons.
and how to disable this property? what line?
You write, that you can disable regular buttons by changing button.disabled
.
With button
you access the button node; with .disabled
you access the property.
With a texture button, the process is the same.
How do you define button
in the line above?
Possibly like this @onready var button = $Button
You would have to adjust it like this: @onready var button = $TextureButton
, depending on the name of the node, that you give the texture button.
That’s how I did it, it doesn’t work for me name.button.disabled = true / false
The following works for me:
@onready var button = $TextureButton
func _on_check_button_toggled(toggled_on: bool) -> void:
button.disabled = toggled_on
If you could share your code, then then the problem might be more easy to identify.
@onready var quitb = $Quit
func _on_quit_pressed():
quitbutton.position.x = 575
quitbutton.position.y = 400
———
func _on_nquit_pressed():
quitbutton.position.x = 5000
quitbutton.position.y = 5000
Please make sure to correctly format source code. You could use the “</>” button of the edit-field for that.
Here are a few things, I have noticed:
quitbutton
anywhere in your code, but instead quitb
.CanvasItem.visible
.</> 123 </>
1 It’s there, I just cut it out
2 ???
3 ok
kakzhe menya zaebal godot
I meant the </> button above the text (6th button from the left in this screenshot of the web interface) and not inserting “</>”:
quitbutton.disabled = true
.