+1 vote

why it did't change color as i want?
getnode("N").set("customstyles/panel/StyleBoxTexture/modulate_color", Color("5cf50000"))
the color just become more darker.. it should change to red

in Engine by (423 points)

Modulate applies a color filter on top of your current texture, so if your panel has some color already, it can look weird in some cases. Try using a grayscale texture if you're going to rely on modulate for colors.

my texture just white.
and i set it to gray. but i make condition, if my item is grade"rare", i want it to change to other color.

Can you post a screenshot of your scene?

enter image description here

Try doing this instead:

get_node("N").get("custom_styles/panel/StyleBoxTexture").modulate_color = Color("e6ff0000")

thanks, it work, but why it wont work before? i cant use set?

I'm not familiar with it, but when I tried print(get("custom_styles/panel/StyleBoxTexture/modulate_color") it printed a reference to StyleBoxTexture instead of a color, so I don't know if you can change it with a set.

Please log in or register to answer this question.

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 Frequently asked questions and 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 [email protected] with your username.