Exemplo n.º 1
0
        public static void Init()
        {
            // Get existing open window or if none, make a new one:
            try
            {
                window = (SoundFontSetupWindow)EditorWindow.GetWindow(typeof(SoundFontSetupWindow));
                window.titleContent.text = "SoundFont Setup";
                window.minSize           = new Vector2(828 + 65, 565);

                styleBold           = new GUIStyle(EditorStyles.boldLabel);
                styleBold.fontStyle = FontStyle.Bold;


                styleRed = new GUIStyle(EditorStyles.label);
                styleRed.normal.textColor = new Color(0.5f, 0, 0);
                styleRed.fontStyle        = FontStyle.Bold;

                styleRichText           = new GUIStyle(EditorStyles.label);
                styleRichText.richText  = true;
                styleRichText.alignment = TextAnchor.UpperLeft;
                heightLine = styleRichText.lineHeight * 1.2f;

                espace       = 5;
                widthLeft    = 415 + 25;
                heightTop    = 130;
                heightMiddle = 150;
                itemHeight   = 25;
                buttonWidth  = 200;
                buttonHeight = 18;

                xpostitlebox = 2;
                ypostitlebox = 5;
            }
            catch (System.Exception ex)
            {
                MidiPlayerGlobal.ErrorDetail(ex);
            }
        }
Exemplo n.º 2
0
        public static void Init()
        {
            //Debug.Log("init");
            // Get existing open window or if none, make a new one:
            try
            {
                window         = GetWindow <SoundFontSetupWindow>(true, "SoundFont Setup");
                window.minSize = new Vector2(828 + 65, 565);

                styleBold           = new GUIStyle(EditorStyles.boldLabel);
                styleBold.fontStyle = FontStyle.Bold;

                styleMiniButton             = new GUIStyle(EditorStyles.miniButtonMid);
                styleMiniButton.fixedWidth  = 16;
                styleMiniButton.fixedHeight = 16;

                styleListTitle = new GUIStyle("box");

                styleRed = new GUIStyle(EditorStyles.label);
                styleRed.normal.textColor = new Color(0.5f, 0, 0);
                styleRed.fontStyle        = FontStyle.Bold;

                styleRichText           = new GUIStyle(EditorStyles.label);
                styleRichText.richText  = true;
                styleRichText.alignment = TextAnchor.UpperLeft;

                styleLabelRight           = new GUIStyle(EditorStyles.label);
                styleLabelRight.alignment = TextAnchor.MiddleRight;
                //styleLabelRight.normal.background = ToolsEditor.SetColor(new Texture2D(2, 2), new Color(.6f, .8f, .6f, 1f));
            }
            catch (System.Exception ex)
            {
                MidiPlayerGlobal.ErrorDetail(ex);
            }
            //Debug.Log("end init");
        }
        public static void Init()
        {
            //Debug.Log("init");
            // Get existing open window or if none, make a new one:
            try
            {
                window         = GetWindow <SoundFontSetupWindow>(true, "SoundFont Setup");
                window.minSize = new Vector2(989, 568);
                //Debug.Log(window.position);

                int        borderSize = 1; // Border size in pixels
                RectOffset rectBorder = new RectOffset(borderSize, borderSize, borderSize, borderSize);

                styleBold                  = new GUIStyle(EditorStyles.boldLabel);
                styleBold.fontStyle        = FontStyle.Bold;
                styleBold.alignment        = TextAnchor.UpperLeft;
                styleBold.normal.textColor = Color.black;

                styleMiniButton             = new GUIStyle(EditorStyles.miniButtonMid);
                styleMiniButton.fixedWidth  = 16;
                styleMiniButton.fixedHeight = 16;
                float gray1 = 0.5f;
                float gray2 = 0.1f;
                float gray3 = 0.7f;
                float gray4 = 0.65f;
                float gray5 = 0.5f;

                styleWindow = new GUIStyle("box");
                styleWindow.normal.background = ToolsEditor.MakeTex(10, 10, new Color(gray5, gray5, gray5, 1f), rectBorder, new Color(gray2, gray2, gray2, 1f));
                styleWindow.alignment         = TextAnchor.MiddleCenter;

                stylePanel = new GUIStyle("box");
                stylePanel.normal.background = ToolsEditor.MakeTex(10, 10, new Color(gray4, gray4, gray4, 1f), rectBorder, new Color(gray2, gray2, gray2, 1f));
                stylePanel.alignment         = TextAnchor.MiddleCenter;

                styleListTitle = new GUIStyle("box");
                styleListTitle.normal.background = ToolsEditor.MakeTex(10, 10, new Color(gray1, gray1, gray1, 1f), rectBorder, new Color(gray2, gray2, gray2, 1f));
                styleListTitle.normal.textColor  = Color.black;
                styleListTitle.alignment         = TextAnchor.MiddleCenter;

                styleListRow = new GUIStyle("box");
                styleListRow.normal.background = ToolsEditor.MakeTex(10, 10, new Color(gray3, gray3, gray3, 1f), rectBorder, new Color(gray2, gray2, gray2, 1f));
                styleListRow.alignment         = TextAnchor.MiddleCenter;

                styleListRowSelected = new GUIStyle("box");
                styleListRowSelected.normal.background = ToolsEditor.MakeTex(10, 10, new Color(.6f, .8f, .6f, 1f), rectBorder, new Color(gray2, gray2, gray2, 1f));
                styleListRowSelected.alignment         = TextAnchor.MiddleCenter;

                styleListLabel                  = new GUIStyle("label");
                styleListLabel.alignment        = TextAnchor.UpperLeft;
                styleListLabel.normal.textColor = Color.black;

                styleToggle = new GUIStyle("toggle");
                //styleToggle.normal.background = ToolsEditor.MakeTex(10, 10, new Color(gray1, gray1, gray1, 1f), rectBorder, new Color(gray2, gray2, gray2, 1f));
                styleToggle.normal.textColor = Color.black;
                //styleToggle.alignment = TextAnchor.MiddleCenter;

                styleRed = new GUIStyle(EditorStyles.label);
                styleRed.normal.textColor = new Color(188f / 255f, 56f / 255f, 56f / 255f);
                //styleRed.fontStyle = FontStyle.Bold;

                styleRichText                  = new GUIStyle(EditorStyles.label);
                styleRichText.richText         = true;
                styleRichText.alignment        = TextAnchor.UpperLeft;
                styleRichText.normal.textColor = Color.black;

                styleLabelRight                  = new GUIStyle(EditorStyles.label);
                styleLabelRight.alignment        = TextAnchor.MiddleRight;
                styleLabelRight.normal.textColor = Color.black;

                styleLabelLeft                  = new GUIStyle(EditorStyles.label);
                styleLabelLeft.alignment        = TextAnchor.MiddleLeft;
                styleLabelLeft.normal.textColor = Color.black;
            }
            catch (System.Exception ex)
            {
                MidiPlayerGlobal.ErrorDetail(ex);
            }
            //Debug.Log("end init");
        }