Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        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));
        }