Example #1
0
        public static InputField CreateTextInputField(GameObject parrent, UiTextInputField textInputObj)
        {
            textInputObj.uiObjName = "textField";
            GameObject inputObj          = CreateButton(parrent, textInputObj, true).gameObject;
            GameObject inputContainerObj = new GameObject("inputContainerObj");

            inputContainerObj.transform.SetParent(inputObj.transform);
            InputField textInput   = inputObj.AddComponent <InputField>();
            GameObject description = CreateTextObj(inputObj, textInputObj.fieldName);

            if (textInputObj.uiButtonText == null)
            {
                textInputObj.uiButtonText        = new UiTextObject();
                textInputObj.uiButtonText.uiText = "";
            }
            textInput.text = textInputObj.uiButtonText.uiText;

            textInputObj.uiButtonText.uiTextColor = new Color32(0, 0, 0, 255);
            textInputObj.uiButtonText.uiSize      = new Vector2(textInputObj.uiSize.x - 15, textInputObj.uiSize.y);
            GameObject text = CreateTextObj(inputObj, textInputObj.uiButtonText);

            textInput.selectionColor = new Color32(0, 48, 255, 255);
            textInput.transition     = Selectable.Transition.None;
            textInput.textComponent  = text.GetComponent <Text>();

            return(textInput);
        }
Example #2
0
        public void CreateConsole(bool fullscreenMode = true)
        {
            fullscreen    = fullscreenMode;
            consoleCanvas = UiManager.CreateCanvas("console ui", this.gameObject);

            // Console Background.
            UiBackgroundObject consoleBackground = new UiBackgroundObject();

            consoleBackground.uiRayCast = false;
            consoleBackground.uiColor   = new Color(0, 0, 0);
            if (fullscreen)
            {
                consoleBackground.uiAnchorMode = UiManager.UiAnchorsMode.FillStretch;
                consoleBackground.uiSize       = new Vector2(0, 0);
            }
            else
            {
                consoleBackground.uiAnchorMode = UiManager.UiAnchorsMode.TopStretchHorizontal;
                consoleBackground.uiSize       = new Vector2(0, 400);
                consoleBackground.uiPosition   = new Vector2(0, 0);
            }
            consoleBackgroundObj = UiManager.CreateBackgroundObj(consoleCanvas, consoleBackground);

            // Console input.  ca 16px txh

            UiTextInputField uiMapName = new UiTextInputField();

            uiMapName.uiPosition                = new Vector2(0, 35);
            uiMapName.uiSize                    = new Vector2(0, 34);
            uiMapName.uiAnchorMode              = UiManager.UiAnchorsMode.BottomStretchHorizontal;
            uiMapName.uiButtonBackgroundObject  = null;
            uiMapName.uiButtonIcon.uiColor      = new Color(1, 1, 1, 1f);
            uiMapName.uiButtonIcon.uiAnchorMode = UiManager.UiAnchorsMode.BottomStretchHorizontal;
            uiMapName.uiButtonIcon.uiSize       = new Vector2(uiMapName.uiSize.x, 1);
            uiMapName.uiButtonIcon.uiPosition   = new Vector2(0, 20);
            uiMapName.fieldName                 = new UiTextObject();
            uiMapName.fieldName.uiText          = "  >";
            uiMapName.fieldName.uiAnchorMode    = UiManager.UiAnchorsMode.BottomStretchHorizontal;
            uiMapName.fieldName.uiSize          = new Vector2(0, 16);
            uiMapName.uiButtonText              = new UiTextObject();
            uiMapName.uiButtonText.uiTextColor  = new Color(1, 1, 1, 1);
            uiMapName.uiButtonText.uiAnchorMode = UiManager.UiAnchorsMode.BottomStretchHorizontal;

            uiMapName.uiButtonText.uiText = "";
            uiMapName.uiButtonText.uiSize = new Vector2(uiMapName.uiSize.x, -10);

            consoleInput                     = UiManager.CreateTextInputField(consoleCanvas, uiMapName);
            consoleInput.caretWidth          = 6;
            consoleInput.selectionColor      = new Color(0, 0, 1, 1);
            consoleInput.textComponent.color = new Color(1, 1, 1, 1);
            consoleInput.textComponent.rectTransform.anchorMin = new Vector2(.01f, 0);
            consoleInput.textComponent.fontSize = 12;
            //consoleInput.Select();
            consoleInput.ActivateInputField();
            consoleInput.onEndEdit.AddListener(delegate { submitToConsole(); });

            // Console log.
        }
Example #3
0
        public static GameObject CreateFileBrowser(GameObject parrent, UiFileBrowser newUiBackground)
        {
            GameObject backgroundObj = CreateUiObject(parrent, newUiBackground);
            Image      curImageComp  = backgroundObj.AddComponent <Image>();

            curImageComp.material      = Resources.Load("BerrySystem/UI/UI_Color", typeof(Material)) as Material;
            curImageComp.color         = newUiBackground.uiColor;
            curImageComp.raycastTarget = newUiBackground.uiRayCast;

            UiTextInputField filePath = new UiTextInputField();

            filePath.uiPosition   = new Vector2(100, -45);
            filePath.uiAnchorMode = UiManager.UiAnchorsMode.TopLeft;
            filePath.uiSize       = new Vector2(185, 32);
            filePath.uiButtonBackgroundObject.uiRayCast    = true;
            filePath.uiButtonBackgroundObject.uiSize       = filePath.uiSize;
            filePath.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            filePath.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            filePath.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            filePath.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            filePath.uiButtonIcon.uiColor  = new Color32(255, 255, 255, 110);
            filePath.uiButtonIcon.uiSize   = new Vector2(filePath.uiSize.x - 2, filePath.uiSize.y - 2);
            filePath.uiButtonText          = new UiTextObject();
            filePath.uiButtonText.uiText   = "Target file path";
            filePath.fieldName             = new UiTextObject();
            filePath.fieldName.uiTextColor = new Color32(0, 0, 0, 255);
            filePath.fieldName.uiTextAlign = TextAnchor.UpperLeft;
            filePath.fieldName.uiSize      = filePath.uiSize;
            filePath.fieldName.uiPosition += new Vector2(3, 25);
            filePath.fieldName.uiText      = newUiBackground.filePathDisplayText;
            CreateTextInputField(backgroundObj, filePath);

            if (newUiBackground.uiTextureRef != null)
            {
                curImageComp.sprite = newUiBackground.uiTextureRef;
            }
            return(backgroundObj);
        }
Example #4
0
        public override void WindowCreate(int sizeX, int sizeY, GameObject windowRef)
        {
            targetWindowRef = windowRef;
            // A realy bad way to overide.
            sizeX = 520;
            sizeY = 400;

            // Create a window shadow.
            windowShadow.uiObjName    = "Shadow";
            windowShadow.uiTextureRef = Resources.Load <Sprite>("BerrySystem/UI/shadow");
            windowShadow.uiColor      = new Color32(255, 255, 255, 255);
            windowShadow.uiSize       = new Vector2(sizeX + 90, sizeY + 90);
            UiManager.CreateBackgroundObj(windowRef, windowShadow);

            // Create the window panel.
            windowPanel.uiSize    = new Vector2(sizeX, sizeY);
            windowPanel.uiRayCast = true;
            UiManager.CreateBackgroundObj(windowRef, windowPanel).transform.parent.gameObject.AddComponent <QuickUiAnimator>().PlayFadeAnim(0, 1, false, false, 9f);

            UiTextObject windowTitle = new UiTextObject();

            windowTitle.uiTextColor = new Color(0, 0, 0, 255);
            windowTitle.uiText      = WindowGrabName();
            windowTitle.uiSize      = new Vector2(100, 19);
            windowTitle.uiTextAlign = TextAnchor.UpperCenter;
            windowTitle.uiPosition  = new Vector2(0, 180);
            UiManager.CreateTextObj(windowRef, windowTitle);

            newXCPInstance = new XCP();

            UiButtonObject saveButton = new UiButtonObject();

            saveButton.uiPosition = new Vector2(210, -165);
            saveButton.uiSize     = new Vector2(70, 34);
            saveButton.uiButtonBackgroundObject.uiRayCast = true;
            saveButton.uiButtonBackgroundObject.uiSize    = saveButton.uiSize;

            saveButton.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            saveButton.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            saveButton.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            saveButton.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            saveButton.uiButtonIcon.uiColor     = new Color32(255, 255, 255, 110);
            saveButton.uiButtonIcon.uiSize      = new Vector2(saveButton.uiSize.x - 2, saveButton.uiSize.y - 2);
            saveButton.uiButtonText             = new UiTextObject();
            saveButton.uiButtonText.uiSize      = saveButton.uiSize;
            saveButton.uiButtonText.uiTextColor = new Color32(0, 0, 0, 255);
            saveButton.uiButtonText.uiTextAlign = TextAnchor.MiddleCenter;
            saveButton.uiButtonText.uiText      = "Create";

            UiManager.CreateButton(windowRef, saveButton).gameObject.AddComponent <DropDownButton>().ACClick = CreateXCP;


            if (!ScenePrimer.curEditorPrimer.editorCreated)
            {
                saveButton.uiButtonText.uiText = "Cancel";
                saveButton.uiPosition          = new Vector2(130, -165);
                UiManager.CreateButton(windowRef, saveButton).gameObject.AddComponent <DropDownButton>().ACClick = WindowTerminate;
            }

            saveButton.uiPosition = new Vector2(0, -165);
            saveButton.uiSize     = new Vector2(90, 34);
            saveButton.uiButtonBackgroundObject.uiSize = saveButton.uiSize;
            saveButton.uiButtonIcon.uiSize             = new Vector2(saveButton.uiSize.x - 2, saveButton.uiSize.y - 2);
            saveButton.uiButtonText.uiText             = "Import icon";
            UiManager.CreateButton(windowRef, saveButton).gameObject.AddComponent <DropDownButton>().ACClick = IconImport;

            UiTextInputField uiMapName = new UiTextInputField();

            uiMapName.uiPosition = new Vector2(0, 116);
            uiMapName.uiSize     = new Vector2(470, 34);
            uiMapName.uiButtonBackgroundObject.uiRayCast    = true;
            uiMapName.uiButtonBackgroundObject.uiSize       = uiMapName.uiSize;
            uiMapName.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            uiMapName.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            uiMapName.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            uiMapName.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            uiMapName.uiButtonIcon          = null;
            uiMapName.fieldName             = new UiTextObject();
            uiMapName.fieldName.uiTextColor = new Color32(0, 0, 0, 255);
            uiMapName.fieldName.uiTextAlign = TextAnchor.UpperLeft;
            uiMapName.fieldName.uiSize      = uiMapName.uiSize;
            uiMapName.fieldName.uiPosition += new Vector2(3, 25);
            uiMapName.fieldName.uiText      = "XCP Name / Game Name";
            fieldObj = UiManager.CreateTextInputField(windowRef, uiMapName);
            fieldObj.onEndEdit.AddListener(delegate { NameUpdate(); });

            uiMapName.fieldName.uiText = "Author";
            uiMapName.uiPosition       = new Vector2(0, 40);
            fieldObj1 = UiManager.CreateTextInputField(windowRef, uiMapName);
            fieldObj1.onEndEdit.AddListener(delegate { AuthorUpdate(); });

            uiMapName.fieldName.uiText = "Description";
            uiMapName.uiPosition       = new Vector2(0, -40);
            fieldObj2 = UiManager.CreateTextInputField(windowRef, uiMapName);
            fieldObj2.onEndEdit.AddListener(delegate { DescriptionUpdate(); });

            UiBackgroundObject icon = new UiBackgroundObject();

            icon.uiSize     = new Vector2(92, 92);
            icon.uiPosition = new Vector2(-120, -120);
            icon.uiColor    = new Color32(230, 230, 230, 255);
            iconPrew        = UiManager.CreateBackgroundObj(windowRef, icon).GetComponent <Image>();

            //
            windowRef.AddComponent <QuickUiAnimator>().PlayPosAnim(new Vector2(0, 20), new Vector2(0, 0), false, false, 120f);
        }
Example #5
0
        public override void WindowCreate(int sizeX, int sizeY, GameObject windowRef)
        {
            targetWindowRef = windowRef;
            // A realy bad way to overide.
            sizeX = 400;
            sizeY = 280;

            // Create a window shadow.
            windowShadow.uiObjName    = "Shadow";
            windowShadow.uiTextureRef = Resources.Load <Sprite>("BerrySystem/UI/shadow");
            windowShadow.uiColor      = new Color32(255, 255, 255, 255);
            windowShadow.uiSize       = new Vector2(sizeX + 90, sizeY + 90);
            UiManager.CreateBackgroundObj(windowRef, windowShadow);

            // Create the window panel.
            windowPanel.uiSize    = new Vector2(sizeX, sizeY);
            windowPanel.uiRayCast = true;
            UiManager.CreateBackgroundObj(windowRef, windowPanel).transform.parent.gameObject.AddComponent <QuickUiAnimator>().PlayFadeAnim(0, 1, false, false, 9f);

            // Window content...
            UiTextObject windowTitle = new UiTextObject();

            windowTitle.uiTextColor = new Color(0, 0, 0, 255);
            windowTitle.uiText      = WindowGrabName();
            windowTitle.uiSize      = new Vector2(77, 19);
            windowTitle.uiTextAlign = TextAnchor.MiddleCenter;
            windowTitle.uiPosition  = new Vector2(0, 120);
            UiManager.CreateTextObj(windowRef, windowTitle);

            UiTextInputField uiMapName = new UiTextInputField();

            uiMapName.uiPosition = new Vector2(0, 30);
            uiMapName.uiSize     = new Vector2(362, 34);
            uiMapName.uiButtonBackgroundObject.uiRayCast    = true;
            uiMapName.uiButtonBackgroundObject.uiSize       = uiMapName.uiSize;
            uiMapName.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            uiMapName.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            uiMapName.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            uiMapName.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            uiMapName.uiButtonIcon.uiColor  = new Color32(255, 255, 255, 110);
            uiMapName.uiButtonIcon.uiSize   = new Vector2(uiMapName.uiSize.x - 2, uiMapName.uiSize.y - 2);
            uiMapName.fieldName             = new UiTextObject();
            uiMapName.fieldName.uiTextColor = new Color32(0, 0, 0, 255);
            uiMapName.fieldName.uiTextAlign = TextAnchor.UpperLeft;
            uiMapName.fieldName.uiSize      = uiMapName.uiSize;
            uiMapName.fieldName.uiPosition += new Vector2(3, 25);
            uiMapName.fieldName.uiText      = "Map Name";
            InputField feildObj0 = UiManager.CreateTextInputField(windowRef, uiMapName);

            uiMapName.fieldName.uiText = "Map File path";
            uiMapName.uiPosition       = new Vector2(0, -50);
            InputField feildObj1 = UiManager.CreateTextInputField(windowRef, uiMapName);

            UiButtonObject saveButton = new UiButtonObject();

            saveButton.uiPosition = new Vector2(156, -103);
            saveButton.uiSize     = new Vector2(50, 34);
            saveButton.uiButtonBackgroundObject.uiRayCast = true;
            saveButton.uiButtonBackgroundObject.uiSize    = saveButton.uiSize;

            saveButton.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            saveButton.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            saveButton.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            saveButton.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            saveButton.uiButtonIcon.uiColor     = new Color32(255, 255, 255, 110);
            saveButton.uiButtonIcon.uiSize      = new Vector2(saveButton.uiSize.x - 2, saveButton.uiSize.y - 2);
            saveButton.uiButtonText             = new UiTextObject();
            saveButton.uiButtonText.uiTextColor = new Color32(0, 0, 0, 255);
            saveButton.uiButtonText.uiTextAlign = TextAnchor.MiddleCenter;
            saveButton.uiButtonText.uiText      = "Open";

            BMapImportBtn curBSaveMapAs = UiManager.CreateButton(windowRef, saveButton).gameObject.AddComponent <BMapImportBtn>();

            curBSaveMapAs.targetFeild0 = feildObj0;
            curBSaveMapAs.targetFeild1 = feildObj1;

            UiTextObject ErrorTitle = new UiTextObject();

            ErrorTitle.uiTextColor = new Color(255, 0, 0, 255);
            ErrorTitle.uiText      = "There must be a name for the map!";
            ErrorTitle.uiSize      = new Vector2(262, 21);
            ErrorTitle.uiPosition  = new Vector2(-50, 0);
            curBSaveMapAs.error0   = UiManager.CreateTextObj(windowRef, ErrorTitle);
            curBSaveMapAs.error0.SetActive(false);

            UiBackgroundObject errorBg = new UiBackgroundObject();

            errorBg.uiColor    = new Color(1, 0, 0, 0.1f);
            errorBg.uiPosition = new Vector2(50, 30);
            errorBg.uiSize     = new Vector2(364, 36);
            UiManager.CreateBackgroundObj(curBSaveMapAs.error0, errorBg);

            UiTextObject ErrorTitle1 = new UiTextObject();

            ErrorTitle1.uiTextColor = new Color(255, 0, 0, 255);
            ErrorTitle1.uiText      = "There must be a valid file path so the map can be saved!!";
            ErrorTitle1.uiSize      = new Vector2(262, 21);
            ErrorTitle1.uiPosition  = new Vector2(-50, -80);
            curBSaveMapAs.error1    = UiManager.CreateTextObj(windowRef, ErrorTitle1);
            curBSaveMapAs.error1.SetActive(false);

            UiBackgroundObject errorBg1 = new UiBackgroundObject();

            errorBg1.uiColor    = new Color(1, 0, 0, 0.1f);
            errorBg1.uiPosition = new Vector2(50, 30);
            errorBg1.uiSize     = new Vector2(364, 36);
            UiManager.CreateBackgroundObj(curBSaveMapAs.error1, errorBg1);

            //
            windowRef.AddComponent <QuickUiAnimator>().PlayPosAnim(new Vector2(0, 20), new Vector2(0, 0), false, false, 120f);
        }
Example #6
0
        public override void WindowCreate(int sizeX, int sizeY, GameObject windowRef)
        {
            targetWindowRef = windowRef;
            // A realy bad way to overide.
            sizeX = 400;
            sizeY = 280;

            // Create a window shadow.
            windowShadow.uiObjName    = "Shadow";
            windowShadow.uiTextureRef = Resources.Load <Sprite>("BerrySystem/UI/shadow");
            windowShadow.uiColor      = new Color32(255, 255, 255, 255);
            windowShadow.uiSize       = new Vector2(sizeX + 90, sizeY + 90);
            UiManager.CreateBackgroundObj(windowRef, windowShadow);

            // Create the window panel.
            windowPanel.uiSize    = new Vector2(sizeX, sizeY);
            windowPanel.uiRayCast = true;
            UiManager.CreateBackgroundObj(windowRef, windowPanel).transform.parent.gameObject.AddComponent <QuickUiAnimator>().PlayFadeAnim(0, 1, false, false, 9f);

            // Window content...
            UiTextObject windowTitle = new UiTextObject();

            windowTitle.uiTextColor = new Color(0, 0, 0, 255);
            windowTitle.uiText      = WindowGrabName();
            windowTitle.uiSize      = new Vector2(77, 19);
            windowTitle.uiTextAlign = TextAnchor.MiddleCenter;
            windowTitle.uiPosition  = new Vector2(0, 120);
            UiManager.CreateTextObj(windowRef, windowTitle);

            UiTextInputField uiMapName = new UiTextInputField();

            uiMapName.uiPosition = new Vector2(0, 30);
            uiMapName.uiSize     = new Vector2(362, 34);
            uiMapName.uiButtonBackgroundObject.uiRayCast    = true;
            uiMapName.uiButtonBackgroundObject.uiSize       = uiMapName.uiSize;
            uiMapName.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            uiMapName.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            uiMapName.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            uiMapName.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            uiMapName.uiButtonIcon.uiColor  = new Color32(255, 255, 255, 110);
            uiMapName.uiButtonIcon.uiSize   = new Vector2(uiMapName.uiSize.x - 2, uiMapName.uiSize.y - 2);
            uiMapName.fieldName             = new UiTextObject();
            uiMapName.fieldName.uiTextColor = new Color32(0, 0, 0, 255);
            uiMapName.fieldName.uiTextAlign = TextAnchor.UpperLeft;
            uiMapName.fieldName.uiSize      = uiMapName.uiSize;
            uiMapName.fieldName.uiPosition += new Vector2(3, 25);
            uiMapName.fieldName.uiText      = "Map Name";
            InputField feildObj = UiManager.CreateTextInputField(windowRef, uiMapName);

            /*
             * uiMapName.fieldName.uiText = "Map File path";
             * uiMapName.uiPosition = new Vector2(0, -40);
             * UiManager.CreateTextInputField(windowRef, uiMapName);
             */

            UiButtonObject saveButton = new UiButtonObject();

            saveButton.uiPosition = new Vector2(156, -103);
            saveButton.uiSize     = new Vector2(50, 34);
            saveButton.uiButtonBackgroundObject.uiRayCast = true;
            saveButton.uiButtonBackgroundObject.uiSize    = saveButton.uiSize;

            saveButton.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            saveButton.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            saveButton.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            saveButton.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            saveButton.uiButtonIcon.uiColor     = new Color32(255, 255, 255, 110);
            saveButton.uiButtonIcon.uiSize      = new Vector2(saveButton.uiSize.x - 2, saveButton.uiSize.y - 2);
            saveButton.uiButtonText             = new UiTextObject();
            saveButton.uiButtonText.uiTextColor = new Color32(0, 0, 0, 255);
            saveButton.uiButtonText.uiTextAlign = TextAnchor.MiddleCenter;
            saveButton.uiButtonText.uiText      = "Create";

            MapNewBtn curMapNewBtn = UiManager.CreateButton(windowRef, saveButton).gameObject.AddComponent <MapNewBtn>();

            curMapNewBtn.targetField = feildObj;

            if (!ScenePrimer.curEditorPrimer.editorCreated)
            {
                saveButton.uiButtonText.uiText = "Cancel";
                saveButton.uiPosition          = new Vector2(100, -103);
                UiManager.CreateButton(windowRef, saveButton).gameObject.AddComponent <DropDownButton>().ACClick = WindowTerminate;
            }

            // Window content...
            UiTextObject ErrorTitle = new UiTextObject();

            ErrorTitle.uiTextColor = new Color(255, 0, 0, 255);
            ErrorTitle.uiText      = "There must be a name for a new map!";
            ErrorTitle.uiSize      = new Vector2(262, 21);
            ErrorTitle.uiPosition  = new Vector2(-50, 0);
            curMapNewBtn.Error     = UiManager.CreateTextObj(windowRef, ErrorTitle);
            curMapNewBtn.Error.SetActive(false);

            UiBackgroundObject errorBg = new UiBackgroundObject();

            errorBg.uiColor    = new Color(1, 0, 0, 0.1f);
            errorBg.uiPosition = new Vector2(50, 30);
            errorBg.uiSize     = new Vector2(364, 36);
            UiManager.CreateBackgroundObj(curMapNewBtn.Error, errorBg);


            //
            windowRef.AddComponent <QuickUiAnimator>().PlayPosAnim(new Vector2(0, 20), new Vector2(0, 0), false, false, 120f);
        }
Example #7
0
        public override void WindowCreate(int sizeX, int sizeY, GameObject windowRef)
        {
            targetWindowRef = windowRef;
            // A realy bad way to overide.
            sizeX = 520;
            sizeY = 400;

            // Create a window shadow.
            windowShadow.uiObjName    = "Shadow";
            windowShadow.uiTextureRef = Resources.Load <Sprite>("BerrySystem/UI/shadow");
            windowShadow.uiColor      = new Color32(255, 255, 255, 255);
            windowShadow.uiSize       = new Vector2(sizeX + 90, sizeY + 90);
            UiManager.CreateBackgroundObj(windowRef, windowShadow);

            // Create the window panel.
            windowPanel.uiSize    = new Vector2(sizeX, sizeY);
            windowPanel.uiRayCast = true;
            UiManager.CreateBackgroundObj(windowRef, windowPanel).transform.parent.gameObject.AddComponent <QuickUiAnimator>().PlayFadeAnim(0, 1, false, false, 9f);

            UiTextObject windowTitle = new UiTextObject();

            windowTitle.uiTextColor = new Color(0, 0, 0, 255);
            windowTitle.uiText      = WindowGrabName();
            windowTitle.uiSize      = new Vector2(100, 19);
            windowTitle.uiTextAlign = TextAnchor.UpperCenter;
            windowTitle.uiPosition  = new Vector2(0, 180);
            UiManager.CreateTextObj(windowRef, windowTitle);

            UiItemFeild uiFileBrowser = new UiItemFeild();

            uiFileBrowser.uiPosition = new Vector2(0, -13);
            uiFileBrowser.uiSize     = new Vector2(470, 256);
            uiFileBrowser.uiColor    = new Color32(239, 239, 239, 255);
            newField = UiManager.CreateItemsFeild(windowRef, uiFileBrowser);


            // Window content...
            UiTextInputField uiMapName = new UiTextInputField();

            uiMapName.uiPosition = new Vector2(0, 136);
            uiMapName.uiSize     = new Vector2(470, 34);
            uiMapName.uiButtonBackgroundObject.uiRayCast    = true;
            uiMapName.uiButtonBackgroundObject.uiSize       = uiMapName.uiSize;
            uiMapName.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            uiMapName.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            uiMapName.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            uiMapName.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            uiMapName.uiButtonIcon          = null;
            uiMapName.fieldName             = new UiTextObject();
            uiMapName.fieldName.uiTextColor = new Color32(0, 0, 0, 255);
            uiMapName.fieldName.uiTextAlign = TextAnchor.UpperLeft;
            uiMapName.fieldName.uiSize      = uiMapName.uiSize;
            uiMapName.fieldName.uiPosition += new Vector2(3, 25);
            uiMapName.fieldName.uiText      = "Textrue filepath";
            feildObj = UiManager.CreateTextInputField(windowRef, uiMapName);
            feildObj.onEndEdit.AddListener(delegate { GoTo(); });

            GenerateFeild(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures));

            UiButtonObject saveButton = new UiButtonObject();

            saveButton.uiPosition = new Vector2(210, -165);
            saveButton.uiSize     = new Vector2(50, 34);
            saveButton.uiButtonBackgroundObject.uiRayCast = true;
            saveButton.uiButtonBackgroundObject.uiSize    = saveButton.uiSize;

            saveButton.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            saveButton.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            saveButton.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            saveButton.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            saveButton.uiButtonIcon.uiColor     = new Color32(255, 255, 255, 110);
            saveButton.uiButtonIcon.uiSize      = new Vector2(saveButton.uiSize.x - 2, saveButton.uiSize.y - 2);
            saveButton.uiButtonText             = new UiTextObject();
            saveButton.uiButtonText.uiTextColor = new Color32(0, 0, 0, 255);
            saveButton.uiButtonText.uiTextAlign = TextAnchor.MiddleCenter;
            saveButton.uiButtonText.uiText      = buttonName;
            saveButtonObj = UiManager.CreateButton(windowRef, saveButton).gameObject;
            saveButtonObj.AddComponent <DropDownButton>().ACClick = Import;

            DropDownOption btnCan = new DropDownOption();

            btnCan.targetNewWindow = new BImporter();
            btnCan.destroy         = true;

            saveButton.uiButtonText.uiText = "Cancel";
            saveButton.uiPosition          = new Vector2(150, -165);
            UiManager.CreateButton(windowRef, saveButton).gameObject.AddComponent <DropDownButton>().ACClick = WindowTerminate;
            //
            windowRef.AddComponent <QuickUiAnimator>().PlayPosAnim(new Vector2(0, 20), new Vector2(0, 0), false, false, 120f);
        }
Example #8
0
        public static GameObject CreateColorInputField(GameObject parrent, UiTextInputField textInputObj, Color32 PresetColor = new Color32(), OptionRunner PassType = null)
        {
            textInputObj.uiObjName = "colorField";
            GameObject inputObj          = CreateButton(parrent, textInputObj, true).gameObject;
            GameObject inputContainerObj = new GameObject("colorObj");

            inputContainerObj.transform.SetParent(inputObj.transform);
            GameObject         description = CreateTextObj(inputObj, textInputObj.fieldName);
            UiBackgroundObject colorPlane  = new UiBackgroundObject();

            colorPlane.uiSize.y     = textInputObj.uiSize.y;
            colorPlane.uiSize.x     = 32;
            colorPlane.uiColor      = new Color(0, 0, 0, 1);
            colorPlane.uiPosition.x = 76;
            GameObject ColorPlane = CreateBackgroundObj(inputObj, colorPlane);

            UiSliderObject slider0 = new UiSliderObject();

            slider0.uiButtonBackgroundObject        = new UiInteractiveBackgroundObject();
            slider0.uiButtonBackgroundObject.uiSize = new Vector2(textInputObj.uiSize.x - 32, 32);
            slider0.uiPosition = new Vector2(-16, 32);
            slider0.uiButtonBackgroundObject.normalColor = new Color(1, 1, 1, 0.3f);
            slider0.uiButtonBackgroundObject.uiRayCast   = true;
            slider0.uiButtonIcon             = null;
            slider0.uiButtonText             = new UiTextObject();
            slider0.uiButtonText.uiText      = "   R";
            slider0.uiButtonText.uiSize      = new Vector2(textInputObj.uiSize.x - 32, 32);
            slider0.uiButtonText.uiTextColor = new Color(0, 0, 0, 1);

            Slider Slider0 = CreateSlider(inputObj, slider0);

            slider0.uiButtonBackgroundObject.uiSize = new Vector2(textInputObj.uiSize.x - 32, 32);
            slider0.uiPosition          = new Vector2(-16, 0);
            slider0.uiButtonText.uiText = "   G";

            Slider Slider1 = CreateSlider(inputObj, slider0);

            slider0.uiButtonBackgroundObject.uiSize = new Vector2(textInputObj.uiSize.x - 32, 32);
            slider0.uiPosition          = new Vector2(-16, -32);
            slider0.uiButtonText.uiText = "   B";

            Slider Slider2 = CreateSlider(inputObj, slider0);

            if (textInputObj.uiButtonText == null)
            {
                textInputObj.uiButtonText        = new UiTextObject();
                textInputObj.uiButtonText.uiText = "";
            }
            ColorPanel curColorPanel = inputObj.AddComponent <ColorPanel>();

            curColorPanel.sliderR   = Slider0;
            curColorPanel.sliderG   = Slider1;
            curColorPanel.sliderB   = Slider2;
            curColorPanel.prewPlane = ColorPlane.GetComponent <Image>();
            curColorPanel.target    = PassType;
            curColorPanel.SetColorNew(PresetColor);

            Slider0.onValueChanged.AddListener(delegate { curColorPanel.UpdateColor(); });
            Slider1.onValueChanged.AddListener(delegate { curColorPanel.UpdateColor(); });
            Slider2.onValueChanged.AddListener(delegate { curColorPanel.UpdateColor(); });

            textInputObj.uiButtonText.uiTextColor = new Color32(0, 0, 0, 255);
            textInputObj.uiButtonText.uiSize      = new Vector2(textInputObj.uiSize.x - 15, textInputObj.uiSize.y);
            GameObject text = CreateTextObj(inputObj, textInputObj.uiButtonText);

            return(null);
        }
Example #9
0
        public override void WindowCreate(int sizeX, int sizeY, GameObject windowRef)
        {
            targetWindowRef = windowRef;
            // A realy bad way to overide.
            sizeX = 200;
            sizeY = Screen.height - 64;

            // Create the window panel.
            windowPanel.uiSize       = new Vector2(sizeX, sizeY);
            windowPanel.uiAnchorMode = UiManager.UiAnchorsMode.MiddelLeftStretchVertical;
            windowPanel.uiPosition   = new Vector2(Screen.width / 2 * -1 + sizeX - 68, -32);
            windowPanel.uiRayCast    = true;
            GameObject panel = UiManager.CreateBackgroundObj(windowRef, windowPanel);

            panel.transform.parent.gameObject.AddComponent <QuickUiAnimator>().PlayFadeAnim(0, 1, false, false, 9f);

            // Editor File Menu
            UiButtonObject editorFileMenu = new UiButtonObject();

            editorFileMenu.uiObjName    = "editorFileMenu";
            editorFileMenu.uiAnchorMode = UiManager.UiAnchorsMode.TopLeft;
            editorFileMenu.uiPosition   = new Vector2(100, -24);
            editorFileMenu.uiSize       = new Vector2(185, 32);
            editorFileMenu.uiStaticObj  = true;
            editorFileMenu.uiButtonBackgroundObject.uiColor = new Color32(155, 155, 155, 100);

            editorFileMenu.uiButtonText             = new UiTextObject();
            editorFileMenu.uiButtonText.uiTextAlign = TextAnchor.MiddleCenter;
            editorFileMenu.uiButtonText.uiText      = "Layers";
            editorFileMenu.uiButtonText.uiTextColor = new Color(0, 0, 0, 1);

            editorFileMenu.uiButtonIcon = new UiBackgroundObject();
            editorFileMenu.uiButtonIcon.uiTextureRef = ScenePrimer.curEditorPrimer.editorIcons[18];
            editorFileMenu.uiButtonIcon.uiColor      = new Color(0, 0, 0, 0.5f);
            editorFileMenu.uiButtonIcon.uiSize       = new Vector2(17, 17);
            editorFileMenu.uiButtonIcon.uiPosition   = new Vector2(78, 0);

            editorFileMenu.uiButtonBackgroundObject.uiRayCast    = true;
            editorFileMenu.uiButtonBackgroundObject.uiSize       = new Vector2(185, 32);
            editorFileMenu.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 70);
            editorFileMenu.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            editorFileMenu.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            UiManager.CreateButton(panel, editorFileMenu).gameObject.AddComponent <editorLayersButton>();

            UiTextInputField uiLayerName = new UiTextInputField();

            uiLayerName.uiPosition   = new Vector2(100, -90);
            uiLayerName.uiAnchorMode = UiManager.UiAnchorsMode.TopLeft;
            uiLayerName.uiSize       = new Vector2(185, 32);
            uiLayerName.uiButtonBackgroundObject.uiRayCast    = true;
            uiLayerName.uiButtonBackgroundObject.uiSize       = uiLayerName.uiSize;
            uiLayerName.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            uiLayerName.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            uiLayerName.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            uiLayerName.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            uiLayerName.uiButtonIcon.uiColor  = new Color32(255, 255, 255, 110);
            uiLayerName.uiButtonIcon.uiSize   = new Vector2(uiLayerName.uiSize.x - 2, uiLayerName.uiSize.y - 2);
            uiLayerName.uiButtonText          = new UiTextObject();
            uiLayerName.uiButtonText.uiText   = XCPManager.currentXCP.xpcMaps[MapDataManager.mapDataXCPIndex].mapLayers[MapDataManager.mapDataCurrentLayer].layerName;
            uiLayerName.fieldName             = new UiTextObject();
            uiLayerName.fieldName.uiTextColor = new Color32(0, 0, 0, 255);
            uiLayerName.fieldName.uiTextAlign = TextAnchor.UpperLeft;
            uiLayerName.fieldName.uiSize      = uiLayerName.uiSize;
            uiLayerName.fieldName.uiPosition += new Vector2(3, 25);
            uiLayerName.fieldName.uiText      = "Layer Name";
            InputField inLayerName = UiManager.CreateTextInputField(panel, uiLayerName);

            inLayerName.onEndEdit.AddListener(delegate { SetLayerName(inLayerName.text); });

            UiTextInputField uiLayerBgColor = new UiTextInputField();

            uiLayerBgColor.uiPosition   = new Vector2(100, -189);
            uiLayerBgColor.uiAnchorMode = UiManager.UiAnchorsMode.TopLeft;
            uiLayerBgColor.uiSize       = new Vector2(185, 98);
            uiLayerBgColor.uiButtonBackgroundObject.uiRayCast    = true;
            uiLayerBgColor.uiButtonBackgroundObject.uiSize       = uiLayerBgColor.uiSize;
            uiLayerBgColor.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            uiLayerBgColor.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            uiLayerBgColor.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            uiLayerBgColor.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            uiLayerBgColor.uiButtonIcon.uiColor  = new Color32(255, 255, 255, 110);
            uiLayerBgColor.uiButtonIcon.uiSize   = new Vector2(uiLayerBgColor.uiSize.x - 2, uiLayerBgColor.uiSize.y - 2);
            uiLayerBgColor.fieldName             = new UiTextObject();
            uiLayerBgColor.fieldName.uiTextColor = new Color32(0, 0, 0, 255);
            uiLayerBgColor.fieldName.uiTextAlign = TextAnchor.UpperLeft;
            uiLayerBgColor.fieldName.uiSize      = uiLayerBgColor.uiSize;
            uiLayerBgColor.fieldName.uiPosition += new Vector2(3, 25);
            uiLayerBgColor.fieldName.uiText      = "Background Color";
            UiManager.CreateColorInputField(panel, uiLayerBgColor, MapDataConverter.ColToColor32(XCPManager.currentXCP.xpcMaps[MapDataManager.mapDataXCPIndex].mapLayers[MapDataManager.mapDataCurrentLayer].bgColor), new RunnerLayerBGColor());

            UiTextInputField uiLayerFgColor = new UiTextInputField();

            uiLayerFgColor.uiPosition   = new Vector2(100, -321.8f);
            uiLayerFgColor.uiAnchorMode = UiManager.UiAnchorsMode.TopLeft;
            uiLayerFgColor.uiSize       = new Vector2(185, 98);
            uiLayerFgColor.uiButtonBackgroundObject.uiRayCast    = true;
            uiLayerFgColor.uiButtonBackgroundObject.uiSize       = uiLayerFgColor.uiSize;
            uiLayerFgColor.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            uiLayerFgColor.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            uiLayerFgColor.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            uiLayerFgColor.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            uiLayerFgColor.uiButtonIcon.uiColor  = new Color32(255, 255, 255, 110);
            uiLayerFgColor.uiButtonIcon.uiSize   = new Vector2(uiLayerFgColor.uiSize.x - 2, uiLayerFgColor.uiSize.y - 2);
            uiLayerFgColor.fieldName             = new UiTextObject();
            uiLayerFgColor.fieldName.uiTextColor = new Color32(0, 0, 0, 255);
            uiLayerFgColor.fieldName.uiTextAlign = TextAnchor.UpperLeft;
            uiLayerFgColor.fieldName.uiSize      = uiLayerFgColor.uiSize;
            uiLayerFgColor.fieldName.uiPosition += new Vector2(3, 25);
            uiLayerFgColor.fieldName.uiText      = "Forground Color";
            UiManager.CreateColorInputField(panel, uiLayerFgColor, MapDataConverter.ColToColor32(XCPManager.currentXCP.xpcMaps[MapDataManager.mapDataXCPIndex].mapLayers[MapDataManager.mapDataCurrentLayer].forColor), new RunnerLayerFGColor());

            UiButtonObject uiLayerPlayerSpawn = new UiButtonObject();

            uiLayerPlayerSpawn.uiPosition   = new Vector2(100, -398.27f);
            uiLayerPlayerSpawn.uiAnchorMode = UiManager.UiAnchorsMode.TopLeft;
            uiLayerPlayerSpawn.uiSize       = new Vector2(185, 32);
            uiLayerPlayerSpawn.uiButtonBackgroundObject.uiRayCast    = true;
            uiLayerPlayerSpawn.uiButtonBackgroundObject.uiSize       = uiLayerPlayerSpawn.uiSize;
            uiLayerPlayerSpawn.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            uiLayerPlayerSpawn.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            uiLayerPlayerSpawn.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            uiLayerPlayerSpawn.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            uiLayerPlayerSpawn.uiButtonIcon.uiColor     = new Color32(255, 255, 255, 110);
            uiLayerPlayerSpawn.uiButtonIcon.uiSize      = new Vector2(uiLayerPlayerSpawn.uiSize.x - 2, uiLayerPlayerSpawn.uiSize.y - 2);
            uiLayerPlayerSpawn.uiButtonText             = new UiTextObject();
            uiLayerPlayerSpawn.uiButtonText.uiTextAlign = TextAnchor.MiddleCenter;
            uiLayerPlayerSpawn.uiButtonText.uiText      = "Set player spawn point";
            uiLayerPlayerSpawn.uiButtonText.uiTextColor = new Color(0, 0, 0, 1);
            uiLayerPlayerSpawn.uiButtonText.uiSize      = new Vector2(185, 32);
            EditorToolIndicator setSpawn = UiManager.CreateButton(panel, uiLayerPlayerSpawn).gameObject.AddComponent <EditorToolIndicator>();
            EditorToolPosition  tool     = new EditorToolPosition();

            tool.toolActiveSetterIcon = Resources.Load <Sprite>("BerrySystem/Textures/Topdown/alphaSpawn");
            setSpawn.targetTool       = tool;

            uiLayerPlayerSpawn.uiPosition          = new Vector2(100, -434.1f);
            uiLayerPlayerSpawn.uiButtonText.uiText = "Main Layer : " + XCPManager.currentXCP.xpcMaps[MapDataManager.mapDataXCPIndex].mapLayers[MapDataManager.mapDataCurrentLayer].mainLayer;
            if (XCPManager.currentXCP.xpcMaps[MapDataManager.mapDataXCPIndex].mapLayers[MapDataManager.mapDataCurrentLayer].mainLayer)
            {
                UiManager.CreateButton(panel, uiLayerPlayerSpawn);
            }
            else
            {
                UiIntractable setToMain = UiManager.CreateButton(panel, uiLayerPlayerSpawn).GetComponent <UiIntractable>();
                setToMain.onMouseClickEvent = SetLayerMain;
            }

            windowRef.AddComponent <QuickUiAnimator>().PlayPosAnim(new Vector2(-230, 0), new Vector2(0, 0), false, false, 1800f);
        }
Example #10
0
        public override void WindowCreate(int sizeX, int sizeY, GameObject windowRef)
        {
            targetWindowRef = windowRef;
            // A realy bad way to overide.
            sizeX = 520;
            sizeY = 400;

            // Create a window shadow.
            windowShadow.uiObjName    = "Shadow";
            windowShadow.uiTextureRef = Resources.Load <Sprite>("BerrySystem/UI/shadow");
            windowShadow.uiColor      = new Color32(255, 255, 255, 255);
            windowShadow.uiSize       = new Vector2(sizeX + 90, sizeY + 90);
            UiManager.CreateBackgroundObj(windowRef, windowShadow);

            // Create the window panel.
            windowPanel.uiSize    = new Vector2(sizeX, sizeY);
            windowPanel.uiRayCast = true;
            UiManager.CreateBackgroundObj(windowRef, windowPanel).transform.parent.gameObject.AddComponent <QuickUiAnimator>().PlayFadeAnim(0, 1, false, false, 9f);

            UiBackgroundObject xpcInfoPanel = new UiBackgroundObject();

            xpcInfoPanel.uiPosition = new Vector2(-108.07f, -15.12f);
            xpcInfoPanel.uiSize     = new Vector2(284.07f, 340.45f);
            xpcInfoPanel.uiColor    = new Color(0.9f, 0.9f, 0.9f, 1);
            UiManager.CreateBackgroundObj(windowRef, xpcInfoPanel);

            UiTextObject windowTitle = new UiTextObject();

            windowTitle.uiTextColor = new Color(0, 0, 0, 255);
            windowTitle.uiSize      = new Vector2(180, 19);
            windowTitle.uiText      = WindowGrabName();
            windowTitle.uiTextAlign = TextAnchor.UpperCenter;
            windowTitle.uiPosition  = new Vector2(0, 180);
            UiManager.CreateTextObj(windowRef, windowTitle);

            if (creationMode)
            {
                newEntity            = new BEnt();
                newEntity.entName    = "new ent";
                newEntity.entType    = 1;
                newEntity.entHealth  = 100;
                newEntity.entSprites = XCPManager.SpritesToPngs(Resources.LoadAll <Sprite>("BerrySystem/Textures/Topdown/newEnt"));
            }
            else
            {
                if (targetEntID == -1)
                {
                    Debug.LogError("Error! taget ent is -1! Set a valid ID");
                }
            }

            UiTextInputField uiMapName = new UiTextInputField();

            uiMapName.uiPosition = new Vector2(143.7f, 115);
            uiMapName.uiSize     = new Vector2(200, 34);
            uiMapName.uiButtonBackgroundObject.uiRayCast    = true;
            uiMapName.uiButtonBackgroundObject.uiSize       = uiMapName.uiSize;
            uiMapName.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            uiMapName.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            uiMapName.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            uiMapName.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            uiMapName.uiButtonIcon.uiColor  = new Color32(255, 255, 255, 110);
            uiMapName.uiButtonIcon.uiSize   = new Vector2(uiMapName.uiSize.x - 2, uiMapName.uiSize.y - 2);
            uiMapName.fieldName             = new UiTextObject();
            uiMapName.fieldName.uiTextColor = new Color32(0, 0, 0, 255);
            uiMapName.fieldName.uiTextAlign = TextAnchor.UpperLeft;
            uiMapName.fieldName.uiSize      = uiMapName.uiSize;
            uiMapName.fieldName.uiPosition += new Vector2(3, 25);
            uiMapName.fieldName.uiText      = "Entity Name";
            uiMapName.uiButtonText          = new UiTextObject();

            if (creationMode)
            {
                uiMapName.uiButtonText.uiText = newEntity.entName;
            }
            else
            {
                uiMapName.uiButtonText.uiText = XCPManager.currentXCP.entities[targetEntID].entName;
            }

            InputField entProperty = UiManager.CreateTextInputField(windowRef, uiMapName);

            entProperty.onEndEdit.AddListener(delegate { EntitySetName(entProperty.text); });

            if (creationMode)
            {
                uiMapName.uiButtonText.uiText = newEntity.entHealth.ToString();
            }
            else
            {
                uiMapName.uiButtonText.uiText = XCPManager.currentXCP.entities[targetEntID].entHealth.ToString();
            }

            uiMapName.fieldName.uiText = "Entity Health";
            uiMapName.uiPosition       = new Vector2(143.7f, 3.25f);
            entProperty             = UiManager.CreateTextInputField(windowRef, uiMapName);
            entProperty.contentType = InputField.ContentType.DecimalNumber;
            entProperty.onEndEdit.AddListener(delegate { EntitySetName(entProperty.text); });

            UiButtonObject editorFileMenu = new UiButtonObject();

            editorFileMenu.uiObjName    = "editorFileMenu";
            editorFileMenu.uiAnchorMode = UiManager.UiAnchorsMode.TopLeft;
            editorFileMenu.uiPosition   = new Vector2(143.7f, 70f);
            editorFileMenu.uiSize       = new Vector2(200, 34);
            editorFileMenu.uiStaticObj  = true;
            editorFileMenu.uiButtonBackgroundObject.uiColor = new Color32(155, 155, 155, 100);

            editorFileMenu.uiButtonText = null;

            editorFileMenu.uiButtonIcon = new UiBackgroundObject();
            editorFileMenu.uiButtonIcon.uiTextureRef = ScenePrimer.curEditorPrimer.editorIcons[18];
            editorFileMenu.uiButtonIcon.uiColor      = new Color(0, 0, 0, 0.5f);
            editorFileMenu.uiButtonIcon.uiSize       = new Vector2(17, 17);
            editorFileMenu.uiButtonIcon.uiPosition   = new Vector2(85, 0);

            editorFileMenu.uiButtonBackgroundObject.uiRayCast    = true;
            editorFileMenu.uiButtonBackgroundObject.uiSize       = new Vector2(200, 34);
            editorFileMenu.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 70);
            editorFileMenu.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            editorFileMenu.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            UiManager.CreateButton(windowRef, editorFileMenu).gameObject.AddComponent <DropDownButton>().ACClick = ItemSelect;

            if (creationMode)
            {
                windowTitle.uiText = "Set Entity type";
            }
            else
            {
                windowTitle.uiText = newEntity.entType.ToString();
            }
            windowTitle.uiTextAlign = TextAnchor.UpperLeft;
            windowTitle.uiPosition  = new Vector2(139.3f, 67.94f);
            entType = UiManager.CreateTextObj(windowRef, windowTitle).GetComponent <Text>();

            UiButtonObject saveButton = new UiButtonObject();

            saveButton.uiPosition = new Vector2(210, -165);
            saveButton.uiSize     = new Vector2(70, 34);
            saveButton.uiButtonBackgroundObject.uiRayCast = true;
            saveButton.uiButtonBackgroundObject.uiSize    = saveButton.uiSize;

            saveButton.uiButtonBackgroundObject.uiColor      = new Color32(100, 100, 100, 100);
            saveButton.uiButtonBackgroundObject.normalColor  = new Color32(170, 170, 170, 100);
            saveButton.uiButtonBackgroundObject.hoverColor   = new Color32(134, 166, 255, 100);
            saveButton.uiButtonBackgroundObject.pressedColor = new Color32(0, 150, 255, 100);
            saveButton.uiButtonIcon.uiColor     = new Color32(255, 255, 255, 110);
            saveButton.uiButtonIcon.uiSize      = new Vector2(saveButton.uiSize.x - 2, saveButton.uiSize.y - 2);
            saveButton.uiButtonText             = new UiTextObject();
            saveButton.uiButtonText.uiTextColor = new Color32(0, 0, 0, 255);
            saveButton.uiButtonText.uiTextAlign = TextAnchor.MiddleCenter;

            if (creationMode)
            {
                saveButton.uiButtonText.uiText = "Create";
                openBtn = UiManager.CreateButton(windowRef, saveButton).GetComponent <UiIntractable>();
                openBtn.onMouseClickEvent = EntityCreate;
            }
            else
            {
                saveButton.uiButtonText.uiText = "Close";
                openBtn = UiManager.CreateButton(windowRef, saveButton).GetComponent <UiIntractable>();
                openBtn.onMouseClickEvent = WindowTerminate;
            }

            saveButton.uiButtonText.uiText = "Animation editor";
            saveButton.uiSize = new Vector2(120, 34);
            saveButton.uiButtonText.uiSize             = saveButton.uiSize;
            saveButton.uiButtonBackgroundObject.uiSize = saveButton.uiSize;
            saveButton.uiButtonIcon.uiSize             = new Vector2(saveButton.uiSize.x - 2, saveButton.uiSize.y - 2);
            saveButton.uiPosition = new Vector2(-186, -165);
            editBtn = UiManager.CreateButton(windowRef, saveButton).GetComponent <UiIntractable>();
            editBtn.onMouseClickEvent = StartSpriteAnimator;

            saveButton.uiButtonText.uiText = "Texture manager";
            saveButton.uiSize = new Vector2(120, 34);
            saveButton.uiButtonText.uiSize             = saveButton.uiSize;
            saveButton.uiButtonBackgroundObject.uiSize = saveButton.uiSize;
            saveButton.uiButtonIcon.uiSize             = new Vector2(saveButton.uiSize.x - 2, saveButton.uiSize.y - 2);
            saveButton.uiPosition = new Vector2(-30, -165);
            editBtn = UiManager.CreateButton(windowRef, saveButton).GetComponent <UiIntractable>();
            editBtn.onMouseClickEvent = StartTextureManager;

            UiBackgroundObject transparacyBg = new UiBackgroundObject();

            transparacyBg.uiSize     = new Vector2(269, 269);
            transparacyBg.uiPosition = new Vector2(-109f, 12f);
            transparacyBg.uiColor    = new Color32(255, 255, 255, 255);
            spritePrew          = UiManager.CreateBackgroundObj(windowRef, transparacyBg).GetComponent <Image>();
            spritePrew.material = Resources.Load("BerrySystem/Shaders/bgTran", typeof(Material)) as Material;

            UiBackgroundObject sprite = new UiBackgroundObject();

            transparacyBg.uiSize     = new Vector2(260, 260);
            transparacyBg.uiPosition = new Vector2(-109f, 12f);
            if (img == null)
            {
                transparacyBg.uiColor = new Color32(255, 255, 255, 0);
            }
            else
            {
                transparacyBg.uiColor = new Color32(255, 255, 255, 255);
            }
            spritePrew                = UiManager.CreateBackgroundObj(windowRef, transparacyBg).GetComponent <Image>();
            spritePrew.sprite         = img;
            spritePrew.preserveAspect = true;

            //
            windowRef.AddComponent <QuickUiAnimator>().PlayPosAnim(new Vector2(0, 20), new Vector2(0, 0), false, false, 120f);
        }