I have a text in my Cui, so how can i update it, When I delete and create a new one has time to disappear, but it should not be seen, please tell me this can be done without removing and creating a new one? If I just create a new one again it overlaps the old ones
How update Cui text?Solved
Only counting down can be automated without using DestroyUi and AddUi. Everything else you have to delete and create again.
ArtiIOMI
Only counting down can be automated without using DestroyUi and AddUi. Everything else you have to delete and create again.
Thank you
ArtiIOMI
Only counting down can be automated without using DestroyUi and AddUi. Everything else you have to delete and create again.
Any examples of the countdown?
CUI.Add(new CuiPanel
{
Image = {
Color = "1 1 1 0"
},
RectTransform = {
AnchorMin = "0.39 0.80",
AnchorMax = "0.63 0.97"
},
CursorEnabled = false
}, "Under", UIName);
var text = new CuiElement
{
Parent = $"{UIName}",
Name = "Timer",
Components = {
new CuiTextComponent {
Text = "%TIME_LEFT%",
FontSize = 30,
Align = TextAnchor.MiddleCenter,
Font = "permanentmarker.ttf",
Color = "0.4 0.7 0.95 1"
},
new CuiRectTransformComponent {
AnchorMin = "0 0",
AnchorMax = "1 1"
},
new CuiOutlineComponent {
Color = "0 0.05 0.3 1",
Distance = "1.0 -1.0"
},
new CuiCountdownComponent
{
StartTime = 60,
EndTime = 0,
Step = 1,
Command = "cmd.after.finish"
}
}
};
CUI.Add(text);Razor
Any examples of the countdown?
Merged post
Add new component
new CuiCountdownComponent
{
StartTime = 60,
EndTime = 0,
Step = 1,
Command = "cmd.after.finish"
}And then add to your text: %TIME_LEFT%
The command will be sent after the countdown is completed by the player who sees this CUI.
then ConsoleSystem.Arg.Player() == Player who seen the UI
Locked automatically