示例#1
0
文件: GuiWindow.cs 项目: bsimser/CoM
        /** Updates the window style */
        private void setStyle(GuiWindowStyle value)
        {
            _style = value;
            // update window style
            switch (WindowStyle)
            {
            case GuiWindowStyle.Normal:
                Style = Engine.GetStyleCopy("Box");
                break;

            case GuiWindowStyle.Clean:
                Style = Engine.GetStyleCopy("Frame");
                break;

            case GuiWindowStyle.Titled:
                Style = Engine.GetStyleCopy("Box");
                break;

            case GuiWindowStyle.Dark:
                Style = Engine.GetStyleCopy("BoxDark");
                break;

            case GuiWindowStyle.Transparent:
                Style = Engine.GetStyleCopy("BoxTrans");
                break;

            case GuiWindowStyle.ThinTransparent:
                Style                   = Engine.GetStyleCopy("BoxTrans");
                Style.border            = new RectOffset(2, 2, 2, 2);
                Style.normal.background = StockTexture.CreateRectTexture(Color.white, Color.black.Faded(0.5f));
                break;
            }
        }
示例#2
0
    public void Clay()
    {
        var diffuseTexture = StockTexture.CreateSolidTexture(Util.HexToColor("FFDAAA"));

        SetShader("Standard");

        SwapTexture(diffuseTexture, "_MainTex");
        SwapTexture(null, "_MetallicGlossMap");

        SetValue("_Glossiness", 0.25f);
        SetValue("_Metallic", 0.2f);
        SetValue("_BumpScale", 0.5f);

        EnableKeyword("_NORMALMAP");
        DisableKeyWord("_METALLICGLOSSMAP");
        DisableKeyWord("_SPECGLOSSMAP");
    }
示例#3
0
文件: GuiListBox.cs 项目: bsimser/CoM
        public GuiListBox(int x, int y, int width = 200, int height = 200, CovertItemToString convertItemToString = null)
            : base(width, height)
        {
            ItemList        = new List <T>();
            SelectedIndex   = 0;
            CanReceiveFocus = true;

            Style.normal.background = StockTexture.CreateSolidTexture(new Color(0f, 0f, 0f, 0.25f));
            EnableBackground        = false;

            ItemStyle                   = Engine.GetStyleCopy("Solid");
            ItemStyle.font              = Engine.Instance.TextFont;
            ItemStyle.fontSize          = 16;
            ItemStyle.alignment         = TextAnchor.MiddleLeft;
            ItemStyle.normal.background = StockTexture.CreateSolidTexture(new Color(0f, 0f, 0f, 0.0f));

            SelectedItemStyle = new GUIStyle(ItemStyle);
            SelectedItemStyle.normal.background = StockTexture.CreateSolidTexture(new Color(0.2f, 0.2f, 0.5f));

            DoConvertItemToString = convertItemToString ?? ((T item) => item.ToString());
        }
示例#4
0
文件: GuiListBox.cs 项目: bsimser/CoM
 /** Sets the background color of the unselected items */
 public void SetBackgroundColor(Color color)
 {
     ItemStyle.normal.background = StockTexture.CreateSolidTexture(color);
 }