public GUI_content
 (
     int ID,
     GUI_Item_Type contentType,
     string text,
     string toolTip,
     GUI_textColor textColor,
     FontStyle fontStyle         = FontStyle.Normal,
     TextAnchor textAlign        = TextAnchor.MiddleCenter,
     GUI_Item_State initialState = GUI_Item_State.NORMAL,
     float fixedWidth            = 0f,
     float fixedHeight           = 0f
 )
 {
     this.ID      = ID;
     ContentType  = contentType;
     Text         = text;
     ToolTip      = toolTip;
     TextColor    = textColor;
     FontStyle    = fontStyle;
     TextAlign    = textAlign;
     InitialState = GUI_Item_State.NORMAL;
     FixedWidth   = fixedWidth;
     FixedHeight  = fixedHeight;
 }
Exemple #2
0
        public static GUIStyle GetGuiStyle
        (
            GUI_Item_Type type,
            GUI_Color colorNormal = GUI_Color.White,
            GUI_Color colorHover  = GUI_Color.White,
            GUI_Color colorActive = GUI_Color.White,
            TextAnchor align      = TextAnchor.MiddleCenter,
            FontStyle fontStyle   = FontStyle.Normal,
            bool wordWrap         = false,
            TextClipping clipping = TextClipping.Overflow
        )
        {
            if (!isInitStyles)
            {
                isInitStyles = SetGUIStyles();
            }

            switch (type)
            {
            case GUI_Item_Type.TITLEBUTTON:
                TitleButton.normal.textColor = GetGuiColor(colorNormal);
                TitleButton.hover.textColor  = GetGuiColor(colorHover);
                TitleButton.active.textColor = GetGuiColor(colorActive);
                TitleButton.fontStyle        = fontStyle;
                TitleButton.alignment        = align;
                TitleButton.wordWrap         = wordWrap;
                TitleButton.clipping         = clipping;
                return(TitleButton);

            case GUI_Item_Type.TITLETEXT:
                SimpleSkin.label.normal.textColor = GetGuiColor(colorNormal);
                SimpleSkin.label.fontStyle        = fontStyle;
                SimpleSkin.label.alignment        = align;
                SimpleSkin.label.wordWrap         = wordWrap;
                SimpleSkin.label.clipping         = clipping;
                return(SimpleSkin.label);

            case GUI_Item_Type.NORMALBUTTON:
                SimpleSkin.button.normal.textColor = GetGuiColor(colorNormal);
                SimpleSkin.button.hover.textColor  = GetGuiColor(colorHover);
                SimpleSkin.button.active.textColor = GetGuiColor(colorActive);
                SimpleSkin.button.fontStyle        = fontStyle;
                SimpleSkin.button.alignment        = align;
                SimpleSkin.button.wordWrap         = wordWrap;
                SimpleSkin.button.clipping         = clipping;
                return(SimpleSkin.button);

            case GUI_Item_Type.TOGGLEBUTTON:
                ToggleButton.normal.textColor = GetGuiColor(colorNormal);
                ToggleButton.hover.textColor  = GetGuiColor(colorHover);
                ToggleButton.active.textColor = GetGuiColor(colorActive);
                ToggleButton.fontStyle        = fontStyle;
                ToggleButton.alignment        = align;
                ToggleButton.wordWrap         = wordWrap;
                ToggleButton.clipping         = clipping;
                return(ToggleButton);

            case GUI_Item_Type.TAB:
                Tab.normal.textColor = GetGuiColor(colorNormal);
                Tab.hover.textColor  = GetGuiColor(colorHover);
                Tab.active.textColor = GetGuiColor(colorActive);
                Tab.fontStyle        = fontStyle;
                Tab.alignment        = align;
                Tab.wordWrap         = wordWrap;
                Tab.clipping         = clipping;
                return(Tab);

            case GUI_Item_Type.LABEL:
                Label.normal.textColor = GetGuiColor(colorNormal);
                Label.fontStyle        = fontStyle;
                Label.alignment        = align;
                Label.wordWrap         = wordWrap;
                Label.clipping         = clipping;
                return(Label);

            case GUI_Item_Type.TEXTFIELD:
                TextField.normal.textColor = GetGuiColor(colorNormal);
                TextField.fontStyle        = fontStyle;
                TextField.alignment        = align;
                TextField.wordWrap         = wordWrap;
                TextField.clipping         = clipping;
                return(TextField);

            case GUI_Item_Type.TEXTAREA:
                TextArea.normal.textColor = GetGuiColor(colorNormal);
                TextArea.fontStyle        = fontStyle;
                TextArea.alignment        = align;
                TextArea.wordWrap         = wordWrap;
                TextArea.clipping         = clipping;
                return(TextArea);

            case GUI_Item_Type.TITLEBOX:
                return(TitleBox);

            case GUI_Item_Type.DROPDOWN:
                return(DropDown);
            }

            return(Label);
        }