The AddOverlay
method is used to add a widget overlay to the editor tool interface. This overlay can be aligned and offset according to the specified parameters.
The AddOverlay
method is used to add a widget overlay to the editor tool interface. This overlay can be aligned and offset according to the specified parameters.
To use the AddOverlay
method, you need to provide a widget that you want to overlay, specify the alignment using the TextFlag
enumeration, and provide an offset as a Vector2
to position the overlay correctly.
// Example of using AddOverlay method public class MyEditorTool : Editor.EditorTool { public void SetupOverlay() { // Create a new widget Editor.Widget myWidget = new Editor.Widget(); // Define alignment and offset Sandbox.TextFlag alignment = Sandbox.TextFlag.Center; Vector2 offset = new Vector2(10, 20); // Add the overlay to the editor tool AddOverlay(myWidget, alignment, offset); } }