示例#1
0
        public static bool AddGuiItemToGroup(
            this List <GuiItem> guiItems,
            string name,
            Rect rect,
            GuiItemType type,
            GuiItemColor itemColor,
            string toolTip                = null,
            GuiItemState state            = GuiItemState.NORMAL,
            bool enabled                  = true,
            FontStyle fontStyle           = FontStyle.Normal,
            TextAnchor textAnchor         = TextAnchor.MiddleCenter,
            Event <object> onChangedEvent = null)
        {
            guiItems.Add(new GuiItem()
            {
                Name           = name,
                Tooltip        = toolTip,
                Type           = type,
                Enabled        = enabled,
                Rect           = rect,
                ItemColor      = itemColor,
                State          = state,
                FontStyle      = fontStyle,
                TextAnchor     = textAnchor,
                OnChangedEvent = onChangedEvent
            });

            return(true);
        }
示例#2
0
        public static bool CreateGuiItemsGroup(
            this List <GuiItem> guiItems,
            List <string> names,
            List <Rect> rects,
            GuiItemType type,
            GuiItemColor itemColor,
            string toolTip                = null,
            GuiItemState state            = GuiItemState.NORMAL,
            bool enabled                  = true,
            FontStyle fontStyle           = FontStyle.Normal,
            TextAnchor textAnchor         = TextAnchor.MiddleCenter,
            Event <object> onChangedEvent = null)
        {
            guiItems.Clear();

            for (int i = 0; i < names.Count; i++)
            {
                guiItems.Add(new GuiItem()
                {
                    Name           = names[i],
                    Tooltip        = toolTip,
                    Type           = type,
                    Enabled        = enabled,
                    Rect           = rects[i],
                    ItemColor      = itemColor,
                    State          = state,
                    FontStyle      = fontStyle,
                    TextAnchor     = textAnchor,
                    OnChangedEvent = onChangedEvent
                });
            }

            return(true);
        }
示例#3
0
 public static void SetGuiItemsGroupLabel(this List <GuiItem> guiItems, string name, Rect rect, GuiItemColor itemColor,
                                          FontStyle fontStyle = FontStyle.Normal, TextAnchor textAnchor = TextAnchor.MiddleLeft)
 {
     guiItems.Add(new GuiItem()
     {
         Name       = name,
         Type       = GuiItemType.LABEL,
         Enabled    = true,
         Rect       = rect,
         ItemColor  = itemColor,
         FontStyle  = fontStyle,
         TextAnchor = textAnchor
     });
 }