Example #1
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);
        }
        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);
        }