0 votes

I would like to return an array showing all properties of a color (e.g. control.modulate). To mean "All Properties", I refer to those listed in the Color Entry of the Docs. I have tried the following code:Contorl.modulate.get_property_list()but it gives an error

Invalid call. Nonexistent function 'get _ property _ list' in base 'Color'.

Thanks for your help in advance!

(My original motive is to Tween on the alpha value of a Control.modulate to give a fading effect. I found in another post that it suffices to use $Tween.interpolate_property(Control, "modulate:a", 1 , 0, 5)
to directly animate the alpha value instead of animating the whole modulate property by like doing

var final_color = Control.modulate
final_color.a = 0   #changing the alpha value
$Tween.interpolate_property(prologue_label,"modulate",modulate,final_color,5)

I wondered how could I get the string "modulate:a"corresponding to the alpha property of the modulate and tried to see if I could print the property list of the modulate to find out the string "modulate:a". This gives the current question after finding out that I cannot use get_property_list() on a Color in general.)

Godot version 3.2.3
in Engine by (17 points)

Color does not inherit from Object, so it does not have get_property_list method. It is unclear for me why do you need to get property_list of Color, if you already know all properties it have?

1 Answer

0 votes

Color has the following properties:
float : r, g, b, a, h, s, v. int : r8, g8, b8, a8.
As mentioned above, get_property_list() is available for any Object, but Color does not extend Object.

"modulate:a" is a NodePath, with ":" serving the purpose of "." in your code. It refers to your prologue_label.modulate.a.

by (2,478 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.