Exemplo n.º 1
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.º 2
0
        private static IMGuiTextPanelContent GetTextPanelContent(RectangleF bounds, float scale)
        {
            //Original colors: hot - new Color(239, 239, 239), active - new Color(191, 191, 191)
            IMGuiTextPanelContent textPanelContent = new IMGuiTextPanelContent(bounds, ButtonNineslice, ButtonColor, Vector2.Zero, ButtonTextAlignment, LabelColor.GetValueOrDefault(), false, scale);

            if (_ButtonSwapType.Has(ButtonSwapType.SwapColor))
            {
                textPanelContent.SetColors(ButtonHotColor, ButtonActiveColor);
            }
            if (_ButtonSwapType.Has(ButtonSwapType.SwapNineSlice))
            {
                textPanelContent.SetColors(ButtonHotColor, ButtonHotNineSlice, ButtonActiveColor, ButtonActiveNineSlice, 1);
            }

            return(textPanelContent);
        }
Exemplo n.º 3
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);
        }