void createDialog()
        {
            ResourceComponent rc = editor.engine.resourceComponent;

            toolDialog = new GUIControl(editor.editorGui);

            GUILabel background = new GUILabel(editor.editorGui, editor.editorGui.leftBG, "World options");

            background.size = new Vector2((editor.editorGui.graphics.width - EditorGUI.RIGHTBOUNDARY) - EditorGUI.LEFTBOUNDARY - 10, EditorGUI.TOPBOUNDARY);
            toolDialog.pos  = new Vector2(toolButton.pos.x + 20, 0);
            toolDialog.add(background);

            selectBehaviorButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/019_buttBack.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/018_buttBack.png"))), "Select Behavior");
            selectBehaviorButton.pos = new Vector2(5, 20);
            toolDialog.add(selectBehaviorButton);

            removeBehaviorButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/019_buttBack.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/018_buttBack.png"))), "Remove Behavior");
            removeBehaviorButton.pos = new Vector2(105, 20);
            toolDialog.add(removeBehaviorButton);

            GUILabel widthLabel = new GUILabel(editor.editorGui, text: "Width");

            widthLabel.pos = new Vector2(4, 50);
            toolDialog.add(widthLabel);

            widthBox          = new GUITextBox(editor.editorGui, "0");
            widthBox.pos      = new Vector2(5, 70);
            widthBox.minWidth = 50;
            widthBox.onText('\b');
            toolDialog.add(widthBox);

            GUILabel heightLabel = new GUILabel(editor.editorGui, text: "Height");

            heightLabel.pos = new Vector2(60, 50);
            toolDialog.add(heightLabel);

            heightBox          = new GUITextBox(editor.editorGui, "0");
            heightBox.pos      = new Vector2(60, 70);
            heightBox.minWidth = 50;
            heightBox.onText('\b');
            toolDialog.add(heightBox);

            resizeButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/019_buttBack.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/018_buttBack.png"))), "Resize");
            resizeButton.pos = new Vector2(115, 70);
            toolDialog.add(resizeButton);

            closeButton      = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/000_solid.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/000_solid.png"))));
            closeButton.pos  = new Vector2(background.size.x - 12, 4);
            closeButton.size = new Vector2(8, 8);
            toolDialog.add(closeButton);
        }
Esempio n. 2
0
        void createDialog()
        {
            toolDialog = new GUIControl(editor.editorGui);

            //Right menu
            GUILabel background = new GUILabel(editor.editorGui, editor.editorGui.leftBG, text: "Actor Tool");

            background.size = new Vector2(EditorGUI.RIGHTBOUNDARY, editor.engine.graphicsComponent.height - EditorGUI.BOTTOMBOUNDARY);
            toolDialog.pos  = new Vector2(editor.engine.graphicsComponent.width - EditorGUI.RIGHTBOUNDARY, 0);
            toolDialog.add(background);

            int numCols = 64 / 32;
            int numRows = editor.editorGui.graphics.height / 32;

            thumbs         = new ScrollingImageTable(editor.editorGui, numRows, numCols, 32, 32, ScrollingImageTable.ScrollDirection.VERTICAL, new Vector2(0, 20));
            thumbs.padding = 4;
            toolDialog.add(thumbs);
        }
Esempio n. 3
0
        void createDialog()
        {
            toolDialog = new GUIControl(editor.editorGui);

            //Right menu
            GUILabel background = new GUILabel(editor.editorGui, editor.editorGui.leftBG, text: "Fill Tool");

            background.size = new Vector2(EditorGUI.RIGHTBOUNDARY, editor.engine.graphicsComponent.height - EditorGUI.BOTTOMBOUNDARY);
            toolDialog.pos  = new Vector2(editor.engine.graphicsComponent.width - EditorGUI.RIGHTBOUNDARY, 0);
            toolDialog.add(background);

            GUILabel critLabel = new GUILabel(editor.editorGui, text: "Criteria:");

            critLabel.pos = new Vector2(0, 25);
            toolDialog.add(critLabel);

            textureCritBox     = new GUICheckBox(editor.editorGui, true, "Same texture");
            textureCritBox.pos = new Vector2(0, 45);
            toolDialog.add(textureCritBox);

            solidityCritBox     = new GUICheckBox(editor.editorGui, false, "Same solidity");
            solidityCritBox.pos = new Vector2(0, 65);
            toolDialog.add(solidityCritBox);

            opacityCritBox     = new GUICheckBox(editor.editorGui, false, "Same opacityFlip");
            opacityCritBox.pos = new Vector2(0, 85);
            toolDialog.add(opacityCritBox);

            GUILabel opLabel = new GUILabel(editor.editorGui, text: "Operator:");

            opLabel.pos = new Vector2(0, 110);
            toolDialog.add(opLabel);

            opControl = new GUIRadioControl(editor.editorGui, (int)Operator.AND);
            opControl.addRadioButton(null, "AND");
            opControl.addRadioButton(null, "OR");
            opControl.pos = new Vector2(0, 130);
            toolDialog.add(opControl);

            GUILabel selectionLabel = new GUILabel(editor.editorGui, text: "Selection:");

            selectionLabel.pos = new Vector2(0, opControl.pos.y + opControl.size.y + 35);
            toolDialog.add(selectionLabel);

            selectionBox     = new GUICheckBox(editor.editorGui, true, "Ignore");
            selectionBox.pos = new Vector2(0, selectionLabel.pos.y + 15);
            toolDialog.add(selectionBox);
        }
        /*
         * Creates all of the GUI components for display
         */

        void createDialog()
        {
            ResourceComponent rc = editor.engine.resourceComponent;

            toolDialog = new GUIControl(editor.editorGui);

            //Right menu
            GUILabel background = new GUILabel(editor.editorGui, editor.editorGui.leftBG, text: "Eraser Tool");

            background.size = new Vector2(EditorGUI.RIGHTBOUNDARY, editor.engine.graphicsComponent.height - EditorGUI.BOTTOMBOUNDARY);
            toolDialog.pos  = new Vector2(editor.engine.graphicsComponent.width - EditorGUI.RIGHTBOUNDARY, 0);
            toolDialog.add(background);

            minus           = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/029_minus.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/030_minusPressed.png"))));
            minus.textColor = new Color(0, 0, 0);
            minus.pos       = new Vector2(0, 20);
            toolDialog.add(minus);

            plus           = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/027_plus.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/028_plusPressed.png"))));
            plus.textColor = new Color(0, 0, 0);
            plus.pos       = new Vector2(minus.size.x, 20);
            toolDialog.add(plus);
        }
        public virtual void addToolButton(GUIButton button, bool atTop)
        {
            if (button != null)
            {
                button.pos = new Vector2(0, atTop ? topPosition : bottomPosition);
                toolButtonsDialog.add(button);
                add(button);
            }

            if (atTop)
            {
                topPosition += BUTTONHEIGHT;
            }
            else
            {
                bottomPosition -= BUTTONHEIGHT;
            }
        }
Esempio n. 6
0
        void createDialog()
        {
            ResourceComponent rc = editor.engine.resourceComponent;

            toolDialog = new GUIControl(editor.editorGui);

            GUILabel background = new GUILabel(editor.editorGui, editor.editorGui.leftBG, "Create a new map");

            background.size = new Vector2(editor.editorGui.graphics.width * .40f, editor.editorGui.graphics.height * .20f);
            toolDialog.pos  = new Vector2(toolButton.pos.x + 20, toolButton.pos.y - background.size.y + 12);
            toolDialog.add(background);

            GUILabel widthPrompt = new GUILabel(editor.editorGui, text: "Width:");

            widthPrompt.pos = new Vector2(5, 20);
            toolDialog.add(widthPrompt);

            widthEntry          = new GUITextBox(editor.editorGui);
            widthEntry.minWidth = 40f;
            widthEntry.maxWidth = 40f;
            widthEntry.pos      = new Vector2(5, 40);
            widthEntry.size     = new Vector2(widthEntry.minWidth, widthEntry.size.y);
            toolDialog.add(widthEntry);

            GUILabel heightPrompt = new GUILabel(editor.editorGui, text: "Height:");

            heightPrompt.pos = new Vector2(widthEntry.maxWidth + 20, 20);
            toolDialog.add(heightPrompt);

            heightEntry          = new GUITextBox(editor.editorGui);
            heightEntry.minWidth = 40f;
            heightEntry.maxWidth = 40f;
            heightEntry.size     = new Vector2(heightEntry.minWidth, widthEntry.size.y);
            heightEntry.pos      = new Vector2(widthEntry.maxWidth + 20, 40);
            toolDialog.add(heightEntry);

            confirmButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/019_buttBack.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/018_buttBack.png"))), "OK");
            confirmButton.pos = new Vector2(5, 60);
            toolDialog.add(confirmButton);

            cancelButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/019_buttBack.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/018_buttBack.png"))), "CANCEL");
            cancelButton.pos = new Vector2(30, 60);
            toolDialog.add(cancelButton);
        }
        void createDialog()
        {
            toolDialog = new GUIControl(editor.editorGui);

            ResourceComponent rc = editor.engine.resourceComponent;

            //Right menu
            GUILabel background = new GUILabel(editor.editorGui, editor.editorGui.leftBG, text: "Selection Tool");

            background.size = new Vector2(EditorGUI.RIGHTBOUNDARY, editor.engine.graphicsComponent.height - EditorGUI.BOTTOMBOUNDARY);
            toolDialog.pos  = new Vector2(editor.engine.graphicsComponent.width - EditorGUI.RIGHTBOUNDARY, 0);
            toolDialog.add(background);

            GUILabel modeLabel = new GUILabel(editor.editorGui, text: "Mode:");

            modeLabel.pos = new Vector2(0, 25);
            toolDialog.add(modeLabel);

            modeControl = new GUIRadioControl(editor.editorGui);
            modeControl.addRadioButton((isdown) => { if (isdown)
                                                     {
                                                         mode = Mode.select;
                                                     }
                                       }, "Select");
            modeControl.addRadioButton((isdown) =>
            {
                if (isdown)
                {
                    //Update mode
                    if (copiedTiles == null)
                    {
                        modeControl.pressed = (int)mode;
                    }
                    else
                    {
                        mode = Mode.paste;

                        //Update selection for copying
                        isDragging  = true;
                        Vector2 pos = editor.engine.graphicsComponent.camera.world2Screen(selection.topLeft * Tile.size);
                        moveAction(pos);
                        isDragging = false;
                    }
                }
            }, "Paste");
            modeControl.pos = new Vector2(0, 45);
            toolDialog.add(modeControl);

            clearButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/019_buttBack.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/018_buttBack.png"))), "Erase");
            clearButton.pos = new Vector2(0, 105);
            toolDialog.add(clearButton);

            GUILabel selectLabel = new GUILabel(editor.editorGui, text: "Select Mode:");

            selectLabel.pos = new Vector2(0, 145);
            toolDialog.add(selectLabel);

            copyButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/019_buttBack.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/018_buttBack.png"))), "Copy");
            copyButton.pos = new Vector2(0, 165);
            toolDialog.add(copyButton);

            GUILabel pasteLabel = new GUILabel(editor.editorGui, text: "Paste Mode:");

            pasteLabel.pos = new Vector2(0, 205);
            toolDialog.add(pasteLabel);

            pasteButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/019_buttBack.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/018_buttBack.png"))), "Paste");
            pasteButton.pos = new Vector2(0, 225);
            toolDialog.add(pasteButton);
        }
Esempio n. 8
0
        void createDialog()
        {
            ResourceComponent rc = editor.engine.resourceComponent;

            toolDialog = new GUIControl(editor.editorGui);

            GUILabel background = new GUILabel(editor.editorGui, editor.editorGui.leftBG, "Treequake options");

            background.size = new Vector2((editor.editorGui.graphics.width - EditorGUI.RIGHTBOUNDARY) - EditorGUI.LEFTBOUNDARY - 10, EditorGUI.BOTTOMBOUNDARY);
            toolDialog.pos  = new Vector2(toolButton.pos.x + 20, editor.editorGui.graphics.height - EditorGUI.BOTTOMBOUNDARY);
            toolDialog.add(background);

            minusButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/029_minus.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/030_minusPressed.png"))));
            minusButton.pos = new Vector2(5, 40);
            toolDialog.add(minusButton);

            defaultButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/025_radio.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/024_radio.png"))));
            defaultButton.pos = defaultButton.pos = new Vector2(20, 40);
            toolDialog.add(defaultButton);

            plusButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/027_plus.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/028_plusPressed.png"))));
            plusButton.pos = plusButton.pos = new Vector2(35, 40);
            toolDialog.add(plusButton);

            GUILabel zoomLabel = new GUILabel(editor.editorGui, text: "Enhance");

            zoomLabel.pos = new Vector2(55, 40);
            toolDialog.add(zoomLabel);

            centerButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/025_radio.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/024_radio.png"))));
            centerButton.pos = new Vector2(5, 60);
            toolDialog.add(centerButton);

            GUILabel centerLabel = new GUILabel(editor.editorGui, text: "Center");

            centerLabel.pos = new Vector2(25, 60);
            toolDialog.add(centerLabel);

            pauseCheckBox     = new GUICheckBox(editor.editorGui, editor.pauseEngine, "Pause Engine");
            pauseCheckBox.pos = new Vector2(5, 20);
            toolDialog.add(pauseCheckBox);

            gridCheckBox     = new GUICheckBox(editor.editorGui, editor.showGrid, "Show Grid");
            gridCheckBox.pos = new Vector2(105, 20);
            toolDialog.add(gridCheckBox);

            overlayCheckBox     = new GUICheckBox(editor.editorGui, editor.showOverlay, "Show Overlay");
            overlayCheckBox.pos = new Vector2(205, 20);
            toolDialog.add(overlayCheckBox);

            ambienceCheckBox     = new GUICheckBox(editor.editorGui, editor.fullAmbient, "Extra Light");
            ambienceCheckBox.pos = new Vector2(105, 40);
            toolDialog.add(ambienceCheckBox);

            closeButton      = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/000_solid.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/000_solid.png"))));
            closeButton.pos  = new Vector2(background.size.x - 12, 4);
            closeButton.size = new Vector2(8, 8);
            toolDialog.add(closeButton);
        }
        void createDialog()
        {
            ResourceComponent rc = editor.engine.resourceComponent;

            toolDialog = new GUIControl(editor.editorGui);

            //Right menu
            GUILabel background = new GUILabel(editor.editorGui, editor.editorGui.leftBG, text: "Pencil Tool");

            background.size = new Vector2(EditorGUI.RIGHTBOUNDARY, editor.engine.graphicsComponent.height - EditorGUI.BOTTOMBOUNDARY);
            toolDialog.pos  = new Vector2(editor.engine.graphicsComponent.width - EditorGUI.RIGHTBOUNDARY, 0);
            toolDialog.add(background);

            GUILabel textureLabel = new GUILabel(editor.editorGui, text: "Texture");

            textureLabel.pos = new Vector2(0, 25);
            toolDialog.add(textureLabel);

            textureOverwriteBox     = new GUICheckBox(editor.editorGui, editor.currentTile.texture != Mapfile.TileData.IGNORESTRING, "Overwrite");
            textureOverwriteBox.pos = new Vector2(0, 40);
            toolDialog.add(textureOverwriteBox);

            int numCols = EditorGUI.RIGHTBOUNDARY / Tile.size;
            int numRows = (editor.engine.graphicsComponent.height / Tile.size) / 3;

            thumbs         = new ScrollingImageTable(editor.editorGui, numRows, numCols, Tile.size, Tile.size, ScrollingImageTable.ScrollDirection.VERTICAL, new Vector2(0, 55));
            thumbs.padding = 2;
            toolDialog.add(thumbs);

            GUILabel solidityLabel = new GUILabel(editor.editorGui, text: "Solidity");

            solidityLabel.pos = new Vector2(0, thumbs.size.y);
            toolDialog.add(solidityLabel);

            solidityOverwriteBox     = new GUICheckBox(editor.editorGui, editor.currentTile.solidity != Mapfile.TileData.IGNOREBYTE, "Overwrite");
            solidityOverwriteBox.pos = new Vector2(0, thumbs.size.y + 15);
            toolDialog.add(solidityOverwriteBox);

            solidityCheckBox     = new GUICheckBox(editor.editorGui, editor.currentValues.solidity == 1, "Is solid");
            solidityCheckBox.pos = new Vector2(0, thumbs.size.y + 30);
            toolDialog.add(solidityCheckBox);

            GUILabel opacityLabel = new GUILabel(editor.editorGui, text: "Opacity");

            opacityLabel.pos = new Vector2(0, thumbs.size.y + 50);
            toolDialog.add(opacityLabel);

            opacityOverwriteBox     = new GUICheckBox(editor.editorGui, editor.currentTile.opacityFlip != Mapfile.TileData.IGNOREBYTE, "Overwrite");
            opacityOverwriteBox.pos = new Vector2(0, thumbs.size.y + 65);
            toolDialog.add(opacityOverwriteBox);

            opacityFlipCheckBox     = new GUICheckBox(editor.editorGui, editor.currentValues.opacityFlip == 1, "Is inverted");
            opacityFlipCheckBox.pos = new Vector2(0, thumbs.size.y + 80);
            toolDialog.add(opacityFlipCheckBox);

            GUILabel behaviorLabel = new GUILabel(editor.editorGui, text: "Behavior");

            behaviorLabel.pos = new Vector2(0, thumbs.size.y + 100);
            toolDialog.add(behaviorLabel);

            behaviorOverwriteBox     = new GUICheckBox(editor.editorGui, editor.currentTile.behavior != Mapfile.TileData.IGNORESTRING, "Overwrite");
            behaviorOverwriteBox.pos = new Vector2(0, thumbs.size.y + 115);
            toolDialog.add(behaviorOverwriteBox);

            behaviorSetButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/019_buttBack.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/018_buttBack.png"))), "Set");
            behaviorSetButton.pos = new Vector2(0, thumbs.size.y + 135);
            toolDialog.add(behaviorSetButton);

            behaviorRemoveButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/019_buttBack.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/018_buttBack.png"))), "Remove");
            behaviorRemoveButton.pos = new Vector2(25, thumbs.size.y + 135);
            toolDialog.add(behaviorRemoveButton);

            addButton     = new GUIButton(editor.editorGui, rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/019_buttBack.png"))), rc.get(Path.GetFullPath(Path.Combine(editor.editorGui.rootDirectory, "GUI/000_EngineGUI/018_buttBack.png"))), "Add custom tile");
            addButton.pos = new Vector2(0, background.size.y - 25);
            toolDialog.add(addButton);
        }