\t is can't ?
Code:var Test = elements.Add(new CuiPanel { Image = { Color = "0.0 0.0 0.0 0" }, RectTransform = { AnchorMin = "0.01 0.85", AnchorMax = "0.3 0.96" }, CursorEnabled = false }, "Overlay", "TEST"); elements.Add(new CuiLabel { Text = { Text = "TEST1 \t TEST1\nTEST2 \t TEST2", FontSize = 15, }, RectTransform = { AnchorMin = "0 0", AnchorMax = "1 1" } }, Test); CuiHelper.AddUi(player, elements); }
Using '\t' in GUI?
Discussion in 'Rust Development' started by saki sakatome, Dec 17, 2016.
-
Wulf Community Admin
Why would you want to use \t? Perhaps you mean \n?
-
-
Wulf Community Admin
-
If you don't like how the tons of spaces look in your code you could create a constant string that is (for example) 10 spaces, and then just concatenate it whenever you need the spaces . Or format your strings with a arg that is 10 spaces.
-
Tabs are not supported by the CUI. You will just have to use spaces (as Wulf suggested), a constant string of spaces (as Eintime suggested) or if you need a variable amount of spaces you could write a method 'string Spaces(int amount)' or something. And if you only plan to display data in columns you could also consider using multiple CUI labels setup next to each other.