public static void DrawGenericLabel(RectangleF bounds, string text) { if (LabelFont.font == null) { NoRegisterError("LabelFont"); return; } if (!LabelColor.HasValue) { NoRegisterError("LabelColor"); return; } IMGUI.Label(new IMGuiTextContent(bounds, Vector2.Zero, LabelTextAlignment, LabelColor.GetValueOrDefault(), true), LabelFont, text); }
public static bool DrawGenericTextureButton(RectangleF bounds, Texture2D texture, Vector2 origin) { if (ButtonNineslice == null) { NoRegisterError("ButtonNineSlice"); return(false); } if (!LabelColor.HasValue) { NoRegisterError("LabelColor"); return(false); } bool ret = IMGUI.Button(GetPanelContent(bounds, ButtonScale)); IMGUI.Texture(new IMGuiContent(bounds.Offset(-origin)), texture, TextureScale); return(ret); }
public static Vector2 DrawGenericDraggable(RectangleF rect, string title) { if (BackgroundNineslice == null) { NoRegisterError("BackgroundNineSlice"); return(Vector2.Zero); } if (!LabelColor.HasValue) { NoRegisterError("LabelColor"); return(Vector2.Zero); } Vector2 dragPos = IMGUI.StartDraggable(new IMGuiDraggableContent(rect, new Size(rect.width, 24), BackgroundNineslice, Color.White, 1) .SetTitle(title, LabelColor.GetValueOrDefault(), LabelFont), true); return(dragPos); }
public static IMGUI.TextboxFlags DrawGenericTextbox(RectangleF bounds, ref string text, IMGUI.TextboxType type) { if (ButtonNineslice == null) { NoRegisterError("ButtonNineSlice"); return(IMGUI.TextboxFlags.None); } if (TextboxFont.font == null) { NoRegisterError("TextboxFont"); return(IMGUI.TextboxFlags.None); } if (!LabelColor.HasValue) { NoRegisterError("LabelColor"); return(IMGUI.TextboxFlags.None); } return(IMGUI.Textbox(GetTextPanelContent(bounds, ButtonScale), TextboxFont, type, ref text)); }
public static bool DrawGenericLabeledButton(RectangleF bounds, string text) { if (ButtonNineslice == null) { NoRegisterError("ButtonNineSlice"); return(false); } if (ButtonFont.font == null) { NoRegisterError("ButtonFont"); return(false); } if (!LabelColor.HasValue) { NoRegisterError("LabelColor"); return(false); } return(IMGUI.TextButton(GetTextPanelContent(bounds, ButtonScale), ButtonFont, text)); }