![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | retsi3602 |
Hey im trying to make a game where based on user input the game gives them a result of perfected, good or incorrect.
In this function I’m trying to change the color of the text based on what is in the text but i really don’t know what I’m doing.
extends RichTextLabel
export (Color,RGB) var text_color
func _ready():
set_modulate(text_color)
pass
func _text_color_changer():
if “Perfected” in text:
text_color = Color(0,255,0)
elif “Good” in text:
text_color = Color(100,200,0)
elif “Incorrect” in text:
text_color = Color(200,0,0)
pass
func _on_LineEdit_text_entered(new_text):
_text_color_changer()
Also if you can i would also like to know how to make the text fade out couple seconds after it appears?
Thanks guys.