Godot Version
godot4.3 C#
Question
My project needs exe transparency, so I set Transparent and per Pixel Transparency in project-General-Display to true, and my rendering mode is Compatibility. Now I will display some pictures after starting the program, so I set texturerect/colorrect’s visible to true, but I found that after setting it to true, the transparency of texturerect/colorrect suddenly changed, and it returned to normal after less than 10 seconds. After testing it several times, I found that if I display the picture after 10 seconds, it will be normal. It seems that the godot engine is initializing something, and it will be fine after initialization (maybe related to rendering), because if I don’t set transparent, there is no problem. Can anyone help me and tell me how to deal with it.
Here is my code,just show the icon
public partial class NodeTest : Node
{
private TextureRect _textureRect;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
_textureRect = GetNode(“TextureRect”);
_textureRect.Texture = GD.Load(“res://icon.svg”);
}
// Called every frame. ‘delta’ is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
public override void _Input(InputEvent @event)
{
if (@event is InputEventKey keyEvent && keyEvent.Pressed)
{
if (keyEvent.Keycode == Key.A)
{
GD.Print(“A was pressed”);
_textureRect.Visible = true;
}
if (keyEvent.Keycode == Key.S)
{
GD.Print("S was pressed");
_textureRect.Visible = false;
}
}
}