void TextStyle(Text t, textStyle style) // text effects { switch (style) { case textStyle.normal: // normal, scale: 1, t.color = Color.black; t.fontStyle = FontStyle.Normal; t.GetComponent <RectTransform>().localScale = Vector3.one; break; case textStyle.hover: t.color = Color.gray; t.fontStyle = FontStyle.Bold; t.GetComponent <RectTransform>().localScale = Vector3.one * 1.01f; break; case textStyle.selected: t.color = Color.red; t.fontStyle = FontStyle.Bold; t.GetComponent <RectTransform>().localScale = Vector3.one * 1.05f; // scale 1.2, bold break; } }
public Text(string t, Vector2 pos, float w, float h, textStyle s) { textStyle = s; text = t; position = pos; width = w; height = h; }