🍥CUI

A full introduction and understanding of the pooling-based CUI.

The CUI system provides a variety of options to design in-game user interfaces in an optimized manner.

Introduction

The system has been meticulously crafted to facilitate seamless development of UI (User Interface) components for Carbon Rust plugins. One of its core strengths lies in its developer-friendly nature, empowering Rust plugin developers to create interfaces with remarkable ease.

A notable aspect of the system is its sophisticated pooling system, intelligently managing and reusing memory for CUI elements. This memory optimization approach ensures optimal performance, striving to deliver the highest efficiency possible.

Getting Started

This system is compatible only with Carbon plugins and may not work with other plugin frameworks or environments.

Each Carbon plugin has its own CuiHandler, which represents a plugin-specific instance of the CUI element pooling and handling. This ensures dedicated resources for each plugin and avoids interference between plugins using the Carbon-only Plugin CUI System.

using var cui = new CUI(CuiHandler);

The using statement in C# is used to ensure proper disposal of resources that implement the IDisposable interface. In the case of the Carbon-only Plugin CUI System, it is crucial to properly manage and release resources to maintain optimal performance and prevent memory leaks.

Using using is strongly recommended because it automatically cleans up system resources when the code block ends. However, if developers don't use using, they should manually call Dispose() on the CUI instance at the very end of the call to release the resources accordingly.

Important to note, setting the id of elements to null, will auto-generate a short indexed value, which gets returned as the string in each Create call.

Last updated