Skip to main content

TextButton

A class in Root.Township, Alta.Meta.UI.

A menu button whose label is drawn by a TextRenderer, kept in step with the button's Label.

Constructors​

MemberWhat it is
TextButton()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

2 private and internal fields
MemberWhat it is
private GameObject buttonObjectThe GameObject that SetButtonLayer changes.
private TextRenderer textRendererThe text that shows the label.

Methods​

MemberWhat it is
void SetButtonLayer(int newLayer)Moves the button object to another physics or render layer.
protected override void Awake()Copies the label onto the text and keeps it updated when the label changes.
2 private and internal methods
MemberWhat it is
private void OnLabelChanged(Button obj)Copies the new label to the text renderer.
private void OnValidate()Editor: syncs the label and the text renderer, taking the text when the label is empty.

Used in​

Members of other types that take, return or hold a TextButton: