public static void write(this string text, string toolTip, int width, PEGI_Styles.PegiGuiStyle style) { textAndTip.text = text; textAndTip.tooltip = toolTip; #if UNITY_EDITOR if (!PaintingGameViewUI) { ef.write(textAndTip, width, style.Current); return; } #endif checkLine(); GUILayout.Label(textAndTip, style.Current, GUILayout.MaxWidth(width)); }
public static void write(this string text, PEGI_Styles.PegiGuiStyle style) { var cnt = TextAndTip(text); #if UNITY_EDITOR if (!PaintingGameViewUI) { ef.write(cnt, style.Current); } else #endif { checkLine(); GUILayout.Label(cnt, style.Current, GuiMaxWidthOption); } }
public static void write(this string text, string toolTip, PEGI_Styles.PegiGuiStyle style) { textAndTip.text = text; textAndTip.tooltip = toolTip; #if UNITY_EDITOR if (!PaintingGameViewUI) { ef.write(textAndTip, style.Current); } else #endif { checkLine(); GUILayout.Label(textAndTip, style.Current, GuiMaxWidthOption); } }
public static void nl(this string value, string hint, PEGI_Styles.PegiGuiStyle style) { write(value, hint, style); nl(); }
private static GUILayoutOption GuiMaxWidthOptionFrom(GUIContent cnt, PEGI_Styles.PegiGuiStyle style) => GUILayout.MaxWidth(Mathf.Min(_playtimeGuiWidth, ApproximateLength(cnt.text, style.Current.fontSize)));
public static bool conditional_enter(this string label, bool canEnter, ref int enteredOne, int thisOne, bool showLabelIfTrue = true, PEGI_Styles.PegiGuiStyle enterLabelStyle = null) { if (!canEnter && enteredOne == thisOne) { if (icon.Back.Click() || "All Done here".ClickText(14)) { enteredOne = -1; } } else { if (canEnter) { label.enter(ref enteredOne, thisOne, showLabelIfTrue, enterLabelStyle); } else { ef.isFoldedOutOrEntered = false; } } return(ef.isFoldedOutOrEntered); }
public static bool conditional_enter(this icon ico, string label, bool canEnter, ref int enteredOne, int thisOne, bool showLabelIfTrue = true, PEGI_Styles.PegiGuiStyle enterLabelStyle = null) { if (!canEnter && enteredOne == thisOne) { enteredOne = -1; } if (canEnter) { ico.enter(label, ref enteredOne, thisOne, showLabelIfTrue, enterLabelStyle); } else { ef.isFoldedOutOrEntered = false; } return(ef.isFoldedOutOrEntered); }
public static bool enter_Inspect(this string txt, IPEGI var, ref int enteredOne, int thisOne, bool showLabelIfTrue = true, PEGI_Styles.PegiGuiStyle enterLabelStyle = null) { var changed = false; txt.TryAddCount(var).enter(ref enteredOne, thisOne, showLabelIfTrue, enterLabelStyle);//) return((ef.isFoldedOutOrEntered && var.Nested_Inspect()) || changed); }
public static bool enter(this string txt, ref int enteredOne, int thisOne, bool showLabelIfTrue = true, PEGI_Styles.PegiGuiStyle enterLabelStyle = null) => icon.Enter.enter(txt, ref enteredOne, thisOne, showLabelIfTrue, enterLabelStyle);
public static bool enter(this icon ico, string txt, ref int enteredOne, int thisOne, bool showLabelIfTrue = true, PEGI_Styles.PegiGuiStyle enterLabelStyle = null) { var outside = enteredOne == -1; var current = enteredOne == thisOne; if (current) { if (icon.Exit.ClickUnFocus("{0} {1}".F(icon.Exit.GetText(), txt))) { enteredOne = -1; } } else if (outside && ico.ClickUnFocus(txt)) { enteredOne = thisOne; } if (((showLabelIfTrue && current) || outside) && txt.ClickLabel(txt, -1, outside ? enterLabelStyle ?? PEGI_Styles.EnterLabel : PEGI_Styles.ExitLabel)) { enteredOne = outside ? thisOne : -1; } ef.isFoldedOutOrEntered = (enteredOne == thisOne); return(ef.isFoldedOutOrEntered); }