Created
March 21, 2015 19:18
-
-
Save mabako/6be62805f95eb87de89a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private UILabel CreateLabel(string type, Vector2 location, string text) | |
{ | |
var lblObject = new GameObject("NameOfTheMod/" + type, typeof(UILabel)); | |
lblObject.transform.parent = panel.transform; | |
var label = lblObject.GetComponent<UILabel>(); | |
label.absolutePosition = location; | |
label.textAlignment = UIHorizontalAlignment.Center; | |
label.verticalAlignment = UIVerticalAlignment.Middle; | |
label.width = labelWidth; | |
label.height = 30; | |
label.text = text; | |
label.textScale = 1.1f; | |
label.textColor = new Color32(255, 255, 255, 255); | |
return label; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment