I am doing cui, but the panel is visible and invisible depending on the resolution. What should I do?
scb.Add(new CuiElement
{
Name = "name1",
Parent = ScoreBoardContainer,
Components =
{
new CuiImageComponent
{
Color = "0.1 0.1 0.1 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.148 0.62",
AnchorMax = "0.898 0.787"
}
}
});
scb.Add(new CuiElement
{
Name = "name1text",
Parent = "name1",
Components =
{
new CuiTextComponent
{
Text = $"{Top[0]}",
FontSize = 30,
Color = "1 1 1 1"
},
new CuiRectTransformComponent
{
AnchorMin = "0.1 0.32",
AnchorMax = "0.88 0.88"
}
}
});
scb.Add(new CuiElement
{
Name = "name2",
Parent = ScoreBoardContainer,
Components =
{
new CuiImageComponent
{
Color = "0.1 0.1 0.1 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.145 0.37",
AnchorMax = "0.895 0.537"
}
}
});
scb.Add(new CuiElement
{
Name = "name2text",
Parent = "name2",
Components =
{
new CuiTextComponent
{
Text = $"{Top[1]}",
FontSize = 30,
Color = "1 1 1 1"
},
new CuiRectTransformComponent
{
AnchorMin = "0.1 0.32",
AnchorMax = "0.88 0.88"
}
}
});
scb.Add(new CuiElement
{
Name = "name3",
Parent = ScoreBoardContainer,
Components =
{
new CuiImageComponent
{
Color = "0.1 0.1 0.1 0"
},
new CuiRectTransformComponent
{
AnchorMin = "0.145 0.09",
AnchorMax = "0.895 0.257"
}
}
});
scb.Add(new CuiElement
{
Name = "name3text",
Parent = "name3",
Components =
{
new CuiTextComponent
{
Text = $"{Top[2]}",
FontSize = 30,
Color = "1 1 1 1"
},
new CuiRectTransformComponent
{
AnchorMin = "0.1 0.32",
AnchorMax = "0.88 0.88"
}
}
});