Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | TheVorkMan_ |
I want make different texture of grabber on N value of slider.
How to make this?
Example:
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | TheVorkMan_ |
I want make different texture of grabber on N value of slider.
How to make this?
Example:
Reply From: | GameSchool |
Hi
If it helps, you can add the signal value_changed
and use an if statement to change the texture of your grabber.
You will have to use self.add_theme_icon_override()
for that.
This function has 2 parameters:
Example:
func _on_value_changed(value):
if(value > 50):
self.add_theme_icon_override("grabber", ImageTexture.new())
No, its not working, or I just stupid and dont understand.
I make this:
var var4 = load("res://big/ass/path/to/image.png")
func _on_value_changed(value):
if(value >= VAR2_start):
self.add_theme_icon_override("grabber", var4)
self.add_theme_icon_override("grabber_highlight", var4)
TheVorkMan_ | 2023-04-09 18:01
Hi
This code actually worked for me.
Did you connect this function to the right signal?
GameSchool | 2023-04-10 05:34