Hi, what's the most efficient way to draw a button with a font?
Currently I'm creating buttons like this because I can't get the Text work with CuiButton.
Background Panel
Text
Invisible Button
So i create 3 Elements in that ElementContainer.
So my question is, is there a Way to draw a button with a text (including outline text) more efficient that I do?
CUIButton with Text + Outline Text
Discussion in 'Rust Development' started by Inofix, Feb 28, 2017.
-
Why not just change the button text? As a button does have a predefined text it sticks in the middle or wherever your textanchor is.
Code:static public void CreateLabel(ref CuiElementContainer container, string panel, string color, string text, int size, string aMin, string aMax, TextAnchor align = TextAnchor.MiddleCenter) { container.Add(new CuiLabel { Text = { Color = color, FontSize = size, Align = align, Text = text }, RectTransform = { AnchorMin = aMin, AnchorMax = aMax } }, panel); }
-
Sorry, i meant a normal Label, not Font.
With my method the Button animation gets lost because it's a invisible button ontop of a Label and I'm trying to combine both to 1 single element.