public override void CreateControls(GUI gui) { toolsPanel = new Panel(new Vector2(200, 180)); toolsPanel.Alpha = 0.6f; toolsPanel.MouseEnabled = true; toolsPanel.BorderSize = 1; toolsPanel.Visible = false; toolsPanel.Pos.Y = (float)Math.Floor(0.5f * (gui.Size.Y - toolsPanel.Size.Y)); gui.AddChild(toolsPanel); lowerButton = new ImageButton(new Vector2(42, 32), "gui/images/downGray.png", lowerButtonClicked); lowerButton.Pos.X = 4; lowerButton.Pos.Y = toolsPanel.Size.Y - lowerButton.Size.Y - 10; lowerButton.Down = true; toolsPanel.AddChild(lowerButton); raiseButton = new ImageButton(new Vector2(42, 32), "gui/images/upGray.png", raiseButtonClicked); raiseButton.Pos.X = 54; raiseButton.Pos.Y = lowerButton.Pos.Y; toolsPanel.AddChild(raiseButton); flattenButton = new ImageButton(new Vector2(42, 32), "gui/images/midGray.png", flattenButtonClicked); flattenButton.Pos.X = 104; flattenButton.Pos.Y = lowerButton.Pos.Y; flattenButton.Down = true; toolsPanel.AddChild(flattenButton); sizeSlider = new Slider("Brush size", toolsPanel.Size.X - 8, brushSizeChanged); sizeSlider.Minimum = 1; sizeSlider.Maximum = 20; sizeSlider.Value = 5; sizeSlider.Pos.X = 4; sizeSlider.Pos.Y = toolsPanel.Size.Y - sizeSlider.Size.Y - 60; toolsPanel.AddChild(sizeSlider); intensitySlider = new Slider("Brush intensity", toolsPanel.Size.X - 8); intensitySlider.Minimum = 0.01f; intensitySlider.Maximum = 1f; intensitySlider.Value = 0.1f; intensitySlider.Pos.X = 4; intensitySlider.Pos.Y = sizeSlider.Pos.Y - 40; toolsPanel.AddChild(intensitySlider); targetHeightSlider = new Slider("Target height", toolsPanel.Size.X - 8); targetHeightSlider.Minimum = 0.0f; targetHeightSlider.Maximum = 40f; targetHeightSlider.Value = 10f; targetHeightSlider.Pos.X = 4; targetHeightSlider.Pos.Y = sizeSlider.Pos.Y - 80; // is added dynamically below brushes = new BrushSelector(); brushes.Pos.X = toolsPanel.Size.X - brushes.Size.X - 4; brushes.Pos.Y = toolsPanel.Size.Y - brushes.Size.Y - 4; toolsPanel.AddChild(brushes); brushSizeChanged(2f * sizeSlider.Value); }
public override void CreateControls(GUI gui) { panel = new FloatPanel(new Vector2(400, 200), "MY SUPER FLOATING PANEL"); panel.Pos.X = 10; panel.Pos.Y = 40; panel.Visible = false; gui.AddChild(panel); //ListBox list = new ListBox(new Vector2(panel.Size.X, panel.Size.Y - 20)); //gui.AddChild(list); }
public override void CreateControls(GUI gui) { listsPanel = new FloatPanel(new Vector2(300, 200), "ENTITIES", false, false); listsPanel.Pos.X = 0; listsPanel.Pos.Y = 22; listsPanel.Visible = false; gui.AddChild(listsPanel); groupsList = new ListBox(new Vector2(120, listsPanel.Size.Y - 24), 1, groupItemSelected); groupsList.Pos.X = 2; groupsList.Pos.Y = 2; listsPanel.AddChild(groupsList); entitiesList = new ListBox(new Vector2(174, listsPanel.Size.Y - 24), 1, entityItemSelected); entitiesList.Pos.X = 124; entitiesList.Pos.Y = 2; listsPanel.AddChild(entitiesList); newEntityDropDown = new DropDown(addEntityDropDownItemSelected); newEntityDropDown.Pos.X = listsPanel.Size.X - 20; listsPanel.AddChild(newEntityDropDown); newEntityDropDown.AddItem("New Checkpoint", 1); newEntityDropDown.AddItem("New Trigger", 1); newEntityDropDown.AddItem("New Recovery Truck", 1); newEntityDropDown.AddItem("New Cone", 1); newEntityDropDown.AddItem("New Explosion", 1); newEntityDropDown.AddItem("New Steam", 1); newEntityDropDown.AddItem("New Fuel Item", 1); newEntityDropDown.AddItem("New Shield Item", 1); newEntityDropDown.AddItem("New Ammo Item", 1); newEntityDropDown.AddItem("New Minigun Item", 1); newEntityDropDown.AddItem("New Missile Item", 1); newEntityDropDown.AddItem("New Booster Item", 1); layout(); }
public override void CreateControls(GUI gui) { /* * selectionPanel = new FloatPanel(new Vector2(300, 200), "DEFINITIONS", false, false); * selectionPanel.Pos.X = 0; * selectionPanel.Pos.Y = 22; * selectionPanel.Visible = false; * gui.AddChild(selectionPanel); * * columnsList = new ListBox(new Vector2(120, selectionPanel.Size.Y - 24), 1, columnItemSelected); * columnsList.Pos.X = 2; * columnsList.Pos.Y = 2; * selectionPanel.AddChild(columnsList); * * blocksList = new ListBox(new Vector2(120, selectionPanel.Size.Y - 24), 1, blockItemSelected); * blocksList.Pos.X = 124; * blocksList.Pos.Y = 2; * selectionPanel.AddChild(blocksList); */ editPanel = new FloatPanel(new Vector2(400, 400), "COLUMN CONFIGURATION", false, false); editPanel.MouseEnabled = false; editPanel.Pos.Y = gui.Size.Y - editPanel.Size.Y - 100; editPanel.Visible = false; gui.AddChild(editPanel); emptyBlockTopBitmap = new Bitmap(Config.DATA_FOLDER + "gui/images/isoCubeTop.png"); emptyBlockBottomBitmap = new Bitmap(Config.DATA_FOLDER + "gui/images/isoCubeBottom.png"); blockButtons = new ImageButton[16]; for (int i = 0; i < 8; i++) { TextureResource tex = new TextureResource("blockButtonTextureT-" + i, emptyBlockTopBitmap); ImageButton btn = new ImageButton(new Vector2(64, 64), tex, null, blockButtonClicked); btn.Tag = i; btn.Pos.X = 30; btn.Pos.Y = 30 + 40 * i; editPanel.AddChild(btn); blockButtons[i * 2] = btn; tex = new TextureResource("blockButtonTextureB-" + i, emptyBlockBottomBitmap); btn = new ImageButton(new Vector2(64, 64), tex, null, blockButtonClicked); btn.Tag = i; btn.Pos.X = editPanel.Size.X - btn.Size.X - 30; btn.Pos.Y = 30 + 40 * i; editPanel.AddChild(btn, 0); blockButtons[i * 2 + 1] = btn; } columnInfo = new Label(new Vector2(200, 14), 9); columnInfo.Pos.X = 120; columnInfo.Pos.Y = editPanel.Size.Y - 70; editPanel.AddChild(columnInfo); editPanelClose = new Button(new Vector2(100, 22), "DONE", null, closeEditPanel); editPanelClose.BorderSize = 1; editPanelClose.Pos.X = (float)Math.Floor(0.5f * (editPanel.Size.X - editPanelClose.Size.X)); editPanelClose.Pos.Y = 50; editPanel.AddChild(editPanelClose); }