Update Elements

By one of June's updates (2023) of Rust, you're now able to update individual CUI elements using the update: true to any CUI element after it has been created on the client. It's important to note that the update only works if the elements already exist on the client, with an initial update: false request.

Creating a testing UI panel with text and buttons

Getting Started

using (var cui = new CUI(CuiHandler))
{
	var container = cui.CreateContainer(cuiTest, xMin: 0.3f, xMax: 0.7f, yMin: 0.3f, yMax: 0.7f, destroyUi: cuiTest);
	var subPanel = cui.CreatePanel(container, cuiTest, null, "0.6 0.6 0.6 1");
	textId2 = cui.CreateText(container, subPanel, null, "1 1 1 1", "asd", xMin: 0.5f, size: 10);
	textId = cui.CreateText(container, subPanel, null, "1 1 1 1", "This is my test", 10, update: false);
	button = cui.CreateProtectedButton(container, subPanel, null, "1 1 1 0.5", "1 1 1 1", string.Empty, 0, 0.4f, 0.6f, 0.4f, 0.6f, command: "boop");
	buttonTxt = cui.CreateText(container, button, null, "1 1 1 0.5", "Hello World", 10);

	Puts($"Created: {textId.Id}");
	cui.Send(container, me);
}  

Last updated