private void BuildUI() { _mapViewContainer = new Panel(); _mapViewContainer.Id = "_mapViewContainer"; var horizontalSeparator1 = new HorizontalSeparator(); _buttonUse = new TextButton(); _buttonUse.Text = "\\c[green]E\\c[white]|Use"; _buttonUse.Width = 100; _buttonUse.Id = "_buttonUse"; _buttonCharacter = new TextButton(); _buttonCharacter.Text = "\\c[green]C\\c[white]haracter"; _buttonCharacter.Width = 100; _buttonCharacter.Id = "_buttonCharacter"; _buttonInventory = new TextButton(); _buttonInventory.Text = "\\c[green]I\\c[white]nventory"; _buttonInventory.Width = 100; _buttonInventory.Id = "_buttonInventory"; _buttonAbilities = new TextButton(); _buttonAbilities.Text = "\\c[green]A\\c[white]bilities"; _buttonAbilities.Width = 100; _buttonAbilities.Id = "_buttonAbilities"; var horizontalStackPanel1 = new HorizontalStackPanel(); horizontalStackPanel1.Spacing = 8; horizontalStackPanel1.Widgets.Add(_buttonUse); horizontalStackPanel1.Widgets.Add(_buttonCharacter); horizontalStackPanel1.Widgets.Add(_buttonInventory); horizontalStackPanel1.Widgets.Add(_buttonAbilities); var verticalStackPanel1 = new VerticalStackPanel(); verticalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); verticalStackPanel1.Widgets.Add(_mapViewContainer); verticalStackPanel1.Widgets.Add(horizontalSeparator1); verticalStackPanel1.Widgets.Add(horizontalStackPanel1); var verticalSeparator1 = new VerticalSeparator(); _labelHp = new Label(); _labelHp.Text = "HP: 50/100"; _labelHp.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center; _labelHp.Id = "_labelHp"; var verticalSeparator2 = new VerticalSeparator(); _labelMana = new Label(); _labelMana.Text = "MA: 50/100"; _labelMana.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center; _labelMana.Id = "_labelMana"; var verticalSeparator3 = new VerticalSeparator(); _labelStamina = new Label(); _labelStamina.Text = "ST: 50/100"; _labelStamina.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center; _labelStamina.Id = "_labelStamina"; var horizontalStackPanel2 = new HorizontalStackPanel(); horizontalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); horizontalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); horizontalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); horizontalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); horizontalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); horizontalStackPanel2.Widgets.Add(_labelHp); horizontalStackPanel2.Widgets.Add(verticalSeparator2); horizontalStackPanel2.Widgets.Add(_labelMana); horizontalStackPanel2.Widgets.Add(verticalSeparator3); horizontalStackPanel2.Widgets.Add(_labelStamina); var horizontalSeparator2 = new HorizontalSeparator(); _mapContainer = new Panel(); _mapContainer.Height = 247; _mapContainer.Id = "_mapContainer"; var horizontalSeparator3 = new HorizontalSeparator(); _logContainer = new Panel(); _logContainer.Id = "_logContainer"; var verticalStackPanel2 = new VerticalStackPanel(); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); verticalStackPanel2.Widgets.Add(horizontalStackPanel2); verticalStackPanel2.Widgets.Add(horizontalSeparator2); verticalStackPanel2.Widgets.Add(_mapContainer); verticalStackPanel2.Widgets.Add(horizontalSeparator3); verticalStackPanel2.Widgets.Add(_logContainer); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, Value = 2, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); Widgets.Add(verticalStackPanel1); Widgets.Add(verticalSeparator1); Widgets.Add(verticalStackPanel2); }
private void BuildUI() { _imageColor = new Image(); _imageColor.Id = "_imageColor"; _imageColor.HeightHint = 50; _imageColor.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _imageColor.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch; var horizontalSeparator1 = new HorizontalSeparator(); horizontalSeparator1.HeightHint = 4; horizontalSeparator1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; horizontalSeparator1.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; horizontalSeparator1.GridPositionY = 1; var textBlock1 = new TextBlock(); textBlock1.Text = "R"; textBlock1.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonR = new SpinButton(); _spinButtonR.Maximum = 255; _spinButtonR.Minimum = 0; _spinButtonR.Value = 0; _spinButtonR.DrawLinesColor = Color.White; _spinButtonR.Id = "_spinButtonR"; _spinButtonR.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonR.GridPositionX = 1; _sliderR = new HorizontalSlider(); _sliderR.Maximum = 255; _sliderR.Id = "_sliderR"; _sliderR.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _sliderR.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderR.GridPositionX = 2; var textBlock2 = new TextBlock(); textBlock2.Text = "G"; textBlock2.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; textBlock2.GridPositionY = 1; _spinButtonG = new SpinButton(); _spinButtonG.Maximum = 255; _spinButtonG.Minimum = 0; _spinButtonG.Value = 0; _spinButtonG.DrawLinesColor = Color.White; _spinButtonG.Id = "_spinButtonG"; _spinButtonG.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonG.GridPositionX = 1; _spinButtonG.GridPositionY = 1; _sliderG = new HorizontalSlider(); _sliderG.Maximum = 255; _sliderG.Id = "_sliderG"; _sliderG.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _sliderG.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderG.GridPositionX = 2; _sliderG.GridPositionY = 1; var textBlock3 = new TextBlock(); textBlock3.Text = "B"; textBlock3.GridPositionY = 2; _spinButtonB = new SpinButton(); _spinButtonB.Maximum = 255; _spinButtonB.Minimum = 0; _spinButtonB.Value = 0; _spinButtonB.DrawLinesColor = Color.White; _spinButtonB.Id = "_spinButtonB"; _spinButtonB.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonB.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonB.GridPositionX = 1; _spinButtonB.GridPositionY = 2; _sliderB = new HorizontalSlider(); _sliderB.Maximum = 255; _sliderB.Id = "_sliderB"; _sliderB.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _sliderB.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderB.GridPositionX = 2; _sliderB.GridPositionY = 2; var textBlock4 = new TextBlock(); textBlock4.Text = "A"; textBlock4.GridPositionY = 3; _spinButtonA = new SpinButton(); _spinButtonA.Maximum = 255; _spinButtonA.Minimum = 0; _spinButtonA.Value = 0; _spinButtonA.DrawLinesColor = Color.White; _spinButtonA.Id = "_spinButtonA"; _spinButtonA.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonA.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonA.GridPositionX = 1; _spinButtonA.GridPositionY = 3; _sliderA = new HorizontalSlider(); _sliderA.Maximum = 255; _sliderA.Id = "_sliderA"; _sliderA.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _sliderA.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderA.GridPositionX = 2; _sliderA.GridPositionY = 3; var grid1 = new Grid(); grid1.DrawLinesColor = Color.White; grid1.ColumnSpacing = 8; grid1.RowSpacing = 4; grid1.ColumnsProportions.Add(new Grid.Proportion()); grid1.ColumnsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Pixels, Value = 50, }); grid1.ColumnsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill, }); grid1.RowsProportions.Add(new Grid.Proportion()); grid1.RowsProportions.Add(new Grid.Proportion()); grid1.RowsProportions.Add(new Grid.Proportion()); grid1.RowsProportions.Add(new Grid.Proportion()); grid1.PaddingTop = 4; grid1.PaddingBottom = 4; grid1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; grid1.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch; grid1.Widgets.Add(textBlock1); grid1.Widgets.Add(_spinButtonR); grid1.Widgets.Add(_sliderR); grid1.Widgets.Add(textBlock2); grid1.Widgets.Add(_spinButtonG); grid1.Widgets.Add(_sliderG); grid1.Widgets.Add(textBlock3); grid1.Widgets.Add(_spinButtonB); grid1.Widgets.Add(_sliderB); grid1.Widgets.Add(textBlock4); grid1.Widgets.Add(_spinButtonA); grid1.Widgets.Add(_sliderA); var verticalSeparator1 = new VerticalSeparator(); verticalSeparator1.WidthHint = 3; verticalSeparator1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center; verticalSeparator1.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch; verticalSeparator1.GridPositionX = 1; var textBlock5 = new TextBlock(); textBlock5.Text = "H"; _spinButtonH = new SpinButton(); _spinButtonH.Maximum = 360; _spinButtonH.Minimum = 0; _spinButtonH.Value = 0; _spinButtonH.DrawLinesColor = Color.White; _spinButtonH.Id = "_spinButtonH"; _spinButtonH.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonH.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonH.GridPositionX = 1; _sliderH = new HorizontalSlider(); _sliderH.Maximum = 360; _sliderH.Id = "_sliderH"; _sliderH.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _sliderH.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderH.GridPositionX = 2; var textBlock6 = new TextBlock(); textBlock6.Text = "S"; textBlock6.GridPositionY = 1; _spinButtonS = new SpinButton(); _spinButtonS.Maximum = 100; _spinButtonS.Minimum = 0; _spinButtonS.Value = 0; _spinButtonS.DrawLinesColor = Color.White; _spinButtonS.Id = "_spinButtonS"; _spinButtonS.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonS.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonS.GridPositionX = 1; _spinButtonS.GridPositionY = 1; _sliderS = new HorizontalSlider(); _sliderS.Maximum = 100; _sliderS.Id = "_sliderS"; _sliderS.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _sliderS.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderS.GridPositionX = 2; _sliderS.GridPositionY = 1; var textBlock7 = new TextBlock(); textBlock7.Text = "V"; textBlock7.GridPositionY = 2; _spinButtonV = new SpinButton(); _spinButtonV.Maximum = 100; _spinButtonV.Minimum = 0; _spinButtonV.Value = 0; _spinButtonV.DrawLinesColor = Color.White; _spinButtonV.Id = "_spinButtonV"; _spinButtonV.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonV.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonV.GridPositionX = 1; _spinButtonV.GridPositionY = 2; _sliderV = new HorizontalSlider(); _sliderV.Maximum = 100; _sliderV.Id = "_sliderV"; _sliderV.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _sliderV.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderV.GridPositionX = 2; _sliderV.GridPositionY = 2; var textBlock8 = new TextBlock(); textBlock8.Text = "#"; textBlock8.GridPositionY = 3; _textFieldHex = new TextField(); _textFieldHex.Text = ""; _textFieldHex.Id = "_textFieldHex"; _textFieldHex.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _textFieldHex.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _textFieldHex.GridPositionX = 1; _textFieldHex.GridPositionY = 3; _textFieldHex.GridSpanX = 2; _textFieldHex.ClipToBounds = true; _textFieldHex.CanFocus = true; var grid2 = new Grid(); grid2.DrawLinesColor = Color.White; grid2.ColumnSpacing = 8; grid2.RowSpacing = 5; grid2.ColumnsProportions.Add(new Grid.Proportion()); grid2.ColumnsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Pixels, Value = 50, }); grid2.ColumnsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill, }); grid2.RowsProportions.Add(new Grid.Proportion()); grid2.RowsProportions.Add(new Grid.Proportion()); grid2.RowsProportions.Add(new Grid.Proportion()); grid2.RowsProportions.Add(new Grid.Proportion()); grid2.PaddingTop = 4; grid2.PaddingBottom = 4; grid2.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; grid2.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch; grid2.GridPositionX = 2; grid2.Widgets.Add(textBlock5); grid2.Widgets.Add(_spinButtonH); grid2.Widgets.Add(_sliderH); grid2.Widgets.Add(textBlock6); grid2.Widgets.Add(_spinButtonS); grid2.Widgets.Add(_sliderS); grid2.Widgets.Add(textBlock7); grid2.Widgets.Add(_spinButtonV); grid2.Widgets.Add(_sliderV); grid2.Widgets.Add(textBlock8); grid2.Widgets.Add(_textFieldHex); var grid3 = new Grid(); grid3.DrawLinesColor = Color.White; grid3.ColumnsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Part, }); grid3.ColumnsProportions.Add(new Grid.Proportion()); grid3.ColumnsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Part, }); grid3.RowsProportions.Add(new Grid.Proportion()); grid3.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; grid3.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch; grid3.GridPositionY = 2; grid3.Widgets.Add(grid1); grid3.Widgets.Add(verticalSeparator1); grid3.Widgets.Add(grid2); var horizontalSeparator2 = new HorizontalSeparator(); horizontalSeparator2.HeightHint = 4; horizontalSeparator2.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; horizontalSeparator2.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; horizontalSeparator2.GridPositionY = 3; _gridUserColors = new Grid(); _gridUserColors.DrawLinesColor = Color.White; _gridUserColors.ColumnSpacing = 4; _gridUserColors.RowSpacing = 4; _gridUserColors.ColumnsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Part, }); _gridUserColors.ColumnsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Part, }); _gridUserColors.ColumnsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Part, }); _gridUserColors.ColumnsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Part, }); _gridUserColors.ColumnsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Part, }); _gridUserColors.ColumnsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Part, }); _gridUserColors.RowsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Part, }); _gridUserColors.RowsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Part, }); _gridUserColors.GridSelectionMode = Myra.Graphics2D.UI.GridSelectionMode.Cell; _gridUserColors.Id = "_gridUserColors"; _gridUserColors.HeightHint = 100; _gridUserColors.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _gridUserColors.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch; _buttonSaveColor = new TextButton(); _buttonSaveColor.Text = "Save Color"; _buttonSaveColor.ContentHorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center; _buttonSaveColor.ContentVerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _buttonSaveColor.Id = "_buttonSaveColor"; _buttonSaveColor.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right; _buttonSaveColor.GridPositionY = 1; var grid4 = new Grid(); grid4.DrawLinesColor = Color.White; grid4.RowSpacing = 4; grid4.RowsProportions.Add(new Grid.Proportion()); grid4.RowsProportions.Add(new Grid.Proportion()); grid4.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; grid4.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch; grid4.GridPositionY = 4; grid4.Widgets.Add(_gridUserColors); grid4.Widgets.Add(_buttonSaveColor); var horizontalSeparator3 = new HorizontalSeparator(); horizontalSeparator3.HeightHint = 4; horizontalSeparator3.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; horizontalSeparator3.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; horizontalSeparator3.GridPositionY = 5; var grid5 = new Grid(); grid5.DrawLinesColor = Color.White; grid5.RowSpacing = -1; grid5.RowsProportions.Add(new Grid.Proportion { Type = Myra.Graphics2D.UI.Grid.ProportionType.Fill, Value = 100, }); grid5.RowsProportions.Add(new Grid.Proportion()); grid5.RowsProportions.Add(new Grid.Proportion()); grid5.RowsProportions.Add(new Grid.Proportion()); grid5.RowsProportions.Add(new Grid.Proportion()); grid5.RowsProportions.Add(new Grid.Proportion()); grid5.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; grid5.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch; grid5.GridPositionY = 1; grid5.Widgets.Add(_imageColor); grid5.Widgets.Add(horizontalSeparator1); grid5.Widgets.Add(grid3); grid5.Widgets.Add(horizontalSeparator2); grid5.Widgets.Add(grid4); grid5.Widgets.Add(horizontalSeparator3); Title = "Color Picker"; TitleTextColor = Color.White; DrawLinesColor = Color.White; XHint = 216; YHint = 220; WidthHint = 450; CanFocus = true; Content = grid5; }
private void BuildUI() { _imageColor = new Image(); _imageColor.Height = 50; _imageColor.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _imageColor.Id = "_imageColor"; var horizontalSeparator1 = new HorizontalSeparator(); horizontalSeparator1.Height = 4; var label1 = new Label(); label1.Text = "R"; label1.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonR = new SpinButton(); _spinButtonR.Maximum = 255; _spinButtonR.Minimum = 0; _spinButtonR.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonR.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonR.GridColumn = 1; _spinButtonR.Id = "_spinButtonR"; _sliderR = new HorizontalSlider(); _sliderR.Maximum = 255; _sliderR.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderR.GridColumn = 2; _sliderR.Id = "_sliderR"; var label2 = new Label(); label2.Text = "G"; label2.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; label2.GridRow = 1; _spinButtonG = new SpinButton(); _spinButtonG.Maximum = 255; _spinButtonG.Minimum = 0; _spinButtonG.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonG.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonG.GridColumn = 1; _spinButtonG.GridRow = 1; _spinButtonG.Id = "_spinButtonG"; _sliderG = new HorizontalSlider(); _sliderG.Maximum = 255; _sliderG.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderG.GridColumn = 2; _sliderG.GridRow = 1; _sliderG.Id = "_sliderG"; var label3 = new Label(); label3.Text = "B"; label3.GridRow = 2; _spinButtonB = new SpinButton(); _spinButtonB.Maximum = 255; _spinButtonB.Minimum = 0; _spinButtonB.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonB.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonB.GridColumn = 1; _spinButtonB.GridRow = 2; _spinButtonB.Id = "_spinButtonB"; _sliderB = new HorizontalSlider(); _sliderB.Maximum = 255; _sliderB.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderB.GridColumn = 2; _sliderB.GridRow = 2; _sliderB.Id = "_sliderB"; var label4 = new Label(); label4.Text = "A"; label4.GridRow = 3; _spinButtonA = new SpinButton(); _spinButtonA.Maximum = 255; _spinButtonA.Minimum = 0; _spinButtonA.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonA.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonA.GridColumn = 1; _spinButtonA.GridRow = 3; _spinButtonA.Id = "_spinButtonA"; _sliderA = new HorizontalSlider(); _sliderA.Maximum = 255; _sliderA.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderA.GridColumn = 2; _sliderA.GridRow = 3; _sliderA.Id = "_sliderA"; var grid1 = new Grid(); grid1.ColumnSpacing = 8; grid1.RowSpacing = 4; grid1.DefaultRowProportion = new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }; grid1.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); grid1.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Pixels, Value = 50, }); grid1.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); grid1.PaddingTop = 4; grid1.PaddingBottom = 4; grid1.Widgets.Add(label1); grid1.Widgets.Add(_spinButtonR); grid1.Widgets.Add(_sliderR); grid1.Widgets.Add(label2); grid1.Widgets.Add(_spinButtonG); grid1.Widgets.Add(_sliderG); grid1.Widgets.Add(label3); grid1.Widgets.Add(_spinButtonB); grid1.Widgets.Add(_sliderB); grid1.Widgets.Add(label4); grid1.Widgets.Add(_spinButtonA); grid1.Widgets.Add(_sliderA); var verticalSeparator1 = new VerticalSeparator(); verticalSeparator1.Width = 3; verticalSeparator1.GridColumn = 1; var label5 = new Label(); label5.Text = "H"; _spinButtonH = new SpinButton(); _spinButtonH.Maximum = 360; _spinButtonH.Minimum = 0; _spinButtonH.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonH.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonH.GridColumn = 1; _spinButtonH.Id = "_spinButtonH"; _sliderH = new HorizontalSlider(); _sliderH.Maximum = 360; _sliderH.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderH.GridColumn = 2; _sliderH.Id = "_sliderH"; var label6 = new Label(); label6.Text = "S"; label6.GridRow = 1; _spinButtonS = new SpinButton(); _spinButtonS.Maximum = 100; _spinButtonS.Minimum = 0; _spinButtonS.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonS.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonS.GridColumn = 1; _spinButtonS.GridRow = 1; _spinButtonS.Id = "_spinButtonS"; _sliderS = new HorizontalSlider(); _sliderS.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderS.GridColumn = 2; _sliderS.GridRow = 1; _sliderS.Id = "_sliderS"; var label7 = new Label(); label7.Text = "V"; label7.GridRow = 2; _spinButtonV = new SpinButton(); _spinButtonV.Maximum = 100; _spinButtonV.Minimum = 0; _spinButtonV.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Stretch; _spinButtonV.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _spinButtonV.GridColumn = 1; _spinButtonV.GridRow = 2; _spinButtonV.Id = "_spinButtonV"; _sliderV = new HorizontalSlider(); _sliderV.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _sliderV.GridColumn = 2; _sliderV.GridRow = 2; _sliderV.Id = "_sliderV"; var label8 = new Label(); label8.Text = "#"; label8.GridRow = 3; _textFieldHex = new TextBox(); _textFieldHex.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; _textFieldHex.GridColumn = 1; _textFieldHex.GridRow = 3; _textFieldHex.GridColumnSpan = 2; _textFieldHex.Id = "_textFieldHex"; var grid2 = new Grid(); grid2.ColumnSpacing = 8; grid2.RowSpacing = 5; grid2.DefaultRowProportion = new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }; grid2.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); grid2.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Pixels, Value = 50, }); grid2.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); grid2.PaddingTop = 4; grid2.PaddingBottom = 4; grid2.GridColumn = 2; grid2.Widgets.Add(label5); grid2.Widgets.Add(_spinButtonH); grid2.Widgets.Add(_sliderH); grid2.Widgets.Add(label6); grid2.Widgets.Add(_spinButtonS); grid2.Widgets.Add(_sliderS); grid2.Widgets.Add(label7); grid2.Widgets.Add(_spinButtonV); grid2.Widgets.Add(_sliderV); grid2.Widgets.Add(label8); grid2.Widgets.Add(_textFieldHex); var grid3 = new Grid(); grid3.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); grid3.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); grid3.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); grid3.RowsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); grid3.Widgets.Add(grid1); grid3.Widgets.Add(verticalSeparator1); grid3.Widgets.Add(grid2); var horizontalSeparator2 = new HorizontalSeparator(); horizontalSeparator2.Height = 4; _gridUserColors = new Grid(); _gridUserColors.ColumnSpacing = 4; _gridUserColors.RowSpacing = 4; _gridUserColors.DefaultColumnProportion = new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }; _gridUserColors.DefaultRowProportion = new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }; _gridUserColors.GridSelectionMode = Myra.Graphics2D.UI.GridSelectionMode.Cell; _gridUserColors.Height = 100; _gridUserColors.Id = "_gridUserColors"; _buttonSaveColor = new TextButton(); _buttonSaveColor.Text = "Save Color"; _buttonSaveColor.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right; _buttonSaveColor.GridRow = 1; _buttonSaveColor.Id = "_buttonSaveColor"; var grid4 = new Grid(); grid4.RowSpacing = 4; grid4.DefaultRowProportion = new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }; grid4.Widgets.Add(_gridUserColors); grid4.Widgets.Add(_buttonSaveColor); var horizontalSeparator3 = new HorizontalSeparator(); horizontalSeparator3.Height = 4; var verticalStackPanel1 = new VerticalStackPanel(); verticalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, Value = 100, }); verticalStackPanel1.Widgets.Add(_imageColor); verticalStackPanel1.Widgets.Add(horizontalSeparator1); verticalStackPanel1.Widgets.Add(grid3); verticalStackPanel1.Widgets.Add(horizontalSeparator2); verticalStackPanel1.Widgets.Add(grid4); verticalStackPanel1.Widgets.Add(horizontalSeparator3); Title = "Color Picker"; Left = 271; Top = 21; Width = 450; Content = verticalStackPanel1; }
private void BuildUI() { var horizontalSeparator1 = new HorizontalSeparator(); var listItem1 = new ListItem(); listItem1.Text = "Rat Skin (5)"; var listItem2 = new ListItem(); listItem2.Text = "Leather Armor (2)"; var listItem3 = new ListItem(); listItem3.Text = "Wolf Skin"; _listBoxItems = new ListBox(); _listBoxItems.Width = 200; _listBoxItems.Height = 200; _listBoxItems.Id = "_listBoxItems"; _listBoxItems.Items.Add(listItem1); _listBoxItems.Items.Add(listItem2); _listBoxItems.Items.Add(listItem3); var verticalSeparator1 = new VerticalSeparator(); _labelResult = new Label(); _labelResult.Text = "Leather(2)"; _labelResult.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center; _labelResult.Id = "_labelResult"; _panelArrow = new Panel(); _panelArrow.Id = "_panelArrow"; var verticalStackPanel1 = new VerticalStackPanel(); verticalStackPanel1.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Center; verticalStackPanel1.Width = 200; verticalStackPanel1.Widgets.Add(_labelResult); verticalStackPanel1.Widgets.Add(_panelArrow); var verticalSeparator2 = new VerticalSeparator(); var listItem4 = new ListItem(); listItem4.Text = "Leather(2)"; _listBoxComponents = new ListBox(); _listBoxComponents.Enabled = false; _listBoxComponents.Width = 200; _listBoxComponents.Height = 200; _listBoxComponents.Id = "_listBoxComponents"; _listBoxComponents.Items.Add(listItem4); var horizontalStackPanel1 = new HorizontalStackPanel(); horizontalStackPanel1.Widgets.Add(_listBoxItems); horizontalStackPanel1.Widgets.Add(verticalSeparator1); horizontalStackPanel1.Widgets.Add(verticalStackPanel1); horizontalStackPanel1.Widgets.Add(verticalSeparator2); horizontalStackPanel1.Widgets.Add(_listBoxComponents); var horizontalSeparator2 = new HorizontalSeparator(); _buttonTan = new TextButton(); _buttonTan.Text = "\\c[green]T\\c[white]an"; _buttonTan.Width = 120; _buttonTan.Id = "_buttonTan"; var horizontalStackPanel2 = new HorizontalStackPanel(); horizontalStackPanel2.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right; horizontalStackPanel2.Widgets.Add(_buttonTan); var verticalStackPanel2 = new VerticalStackPanel(); verticalStackPanel2.Widgets.Add(horizontalSeparator1); verticalStackPanel2.Widgets.Add(horizontalStackPanel1); verticalStackPanel2.Widgets.Add(horizontalSeparator2); verticalStackPanel2.Widgets.Add(horizontalStackPanel2); Title = "Leather Tanning Bench"; Left = 369; Top = 141; Content = verticalStackPanel2; }
private void BuildUI() { var label1 = new Label(); label1.Text = "Font Resolution Factor:"; _spinButtonFontResolutionFactor = new SpinButton(); _spinButtonFontResolutionFactor.Value = 2; _spinButtonFontResolutionFactor.Width = 50; _spinButtonFontResolutionFactor.Id = "_spinButtonFontResolutionFactor"; var horizontalStackPanel1 = new HorizontalStackPanel(); horizontalStackPanel1.Spacing = 8; horizontalStackPanel1.Widgets.Add(label1); horizontalStackPanel1.Widgets.Add(_spinButtonFontResolutionFactor); var verticalSeparator1 = new VerticalSeparator(); var label2 = new Label(); label2.Text = "Kernel Width:"; _spinButtonKernelWidth = new SpinButton(); _spinButtonKernelWidth.Value = 2; _spinButtonKernelWidth.Integer = true; _spinButtonKernelWidth.Width = 50; _spinButtonKernelWidth.Id = "_spinButtonKernelWidth"; var horizontalStackPanel2 = new HorizontalStackPanel(); horizontalStackPanel2.Spacing = 8; horizontalStackPanel2.Widgets.Add(label2); horizontalStackPanel2.Widgets.Add(_spinButtonKernelWidth); var verticalSeparator2 = new VerticalSeparator(); var label3 = new Label(); label3.Text = "Kernel Height:"; _spinButtonKernelHeight = new SpinButton(); _spinButtonKernelHeight.Value = 2; _spinButtonKernelHeight.Integer = true; _spinButtonKernelHeight.Width = 50; _spinButtonKernelHeight.Id = "_spinButtonKernelHeight"; var horizontalStackPanel3 = new HorizontalStackPanel(); horizontalStackPanel3.Spacing = 8; horizontalStackPanel3.Widgets.Add(label3); horizontalStackPanel3.Widgets.Add(_spinButtonKernelHeight); var verticalSeparator3 = new VerticalSeparator(); var label4 = new Label(); label4.Text = "Scale:"; _spinButtonScale = new SpinButton(); _spinButtonScale.Value = 2; _spinButtonScale.Width = 50; _spinButtonScale.Id = "_spinButtonScale"; var horizontalStackPanel4 = new HorizontalStackPanel(); horizontalStackPanel4.Spacing = 8; horizontalStackPanel4.Widgets.Add(label4); horizontalStackPanel4.Widgets.Add(_spinButtonScale); var verticalSeparator4 = new VerticalSeparator(); _checkBoxDrawBackground = new CheckBox(); _checkBoxDrawBackground.Text = "Draw Background"; _checkBoxDrawBackground.Id = "_checkBoxDrawBackground"; var horizontalStackPanel5 = new HorizontalStackPanel(); horizontalStackPanel5.Widgets.Add(horizontalStackPanel1); horizontalStackPanel5.Widgets.Add(verticalSeparator1); horizontalStackPanel5.Widgets.Add(horizontalStackPanel2); horizontalStackPanel5.Widgets.Add(verticalSeparator2); horizontalStackPanel5.Widgets.Add(horizontalStackPanel3); horizontalStackPanel5.Widgets.Add(verticalSeparator3); horizontalStackPanel5.Widgets.Add(horizontalStackPanel4); horizontalStackPanel5.Widgets.Add(verticalSeparator4); horizontalStackPanel5.Widgets.Add(_checkBoxDrawBackground); var horizontalSeparator1 = new HorizontalSeparator(); _panelTopContainer = new Panel(); _panelTopContainer.Id = "_panelTopContainer"; var horizontalSeparator2 = new HorizontalSeparator(); _panelBottomContainer = new Panel(); _panelBottomContainer.Id = "_panelBottomContainer"; Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); Widgets.Add(horizontalStackPanel5); Widgets.Add(horizontalSeparator1); Widgets.Add(_panelTopContainer); Widgets.Add(horizontalSeparator2); Widgets.Add(_panelBottomContainer); }
private void BuildUI() { var label1 = new Label(); label1.Text = "Equipment"; var horizontalSeparator1 = new HorizontalSeparator(); var label2 = new Label(); label2.Text = "<light>"; var label3 = new Label(); label3.Text = "eye of the deep"; label3.GridColumn = 1; var label4 = new Label(); label4.Text = "<left finger>"; label4.GridRow = 1; var label5 = new Label(); label5.Text = "a carved wooden ring"; label5.GridColumn = 1; label5.GridRow = 1; var label6 = new Label(); label6.Text = "<right finger>"; label6.GridRow = 2; var label7 = new Label(); label7.Text = "a carved wooden ring"; label7.GridColumn = 1; label7.GridRow = 2; var label8 = new Label(); label8.Text = "<neck 1>"; label8.GridRow = 3; var label9 = new Label(); label9.Text = "the amulet of the sanguineous magi"; label9.GridColumn = 1; label9.GridRow = 3; var label10 = new Label(); label10.Text = "<neck 2>"; label10.GridRow = 4; var label11 = new Label(); label11.Text = "the amulet of the sanguineous magi"; label11.GridColumn = 1; label11.GridRow = 4; var label12 = new Label(); label12.Text = "<body>"; label12.GridRow = 5; var label13 = new Label(); label13.Text = "a gilded corset of crimson and gold"; label13.GridColumn = 1; label13.GridRow = 5; var label14 = new Label(); label14.Text = "<head>"; label14.GridRow = 6; var label15 = new Label(); label15.Text = "The Crown of Thorns"; label15.GridColumn = 1; label15.GridRow = 6; var label16 = new Label(); label16.Text = "<legs>"; label16.GridRow = 7; var label17 = new Label(); label17.Text = "Ogre Hide Leggings"; label17.GridColumn = 1; label17.GridRow = 7; var label18 = new Label(); label18.Text = "<feet>"; label18.GridRow = 8; var label19 = new Label(); label19.Text = "a pair of dolphin skin boots"; label19.GridColumn = 1; label19.GridRow = 8; var label20 = new Label(); label20.Text = "<hands>"; label20.GridRow = 9; var label21 = new Label(); label21.Text = "gloves of the yellow rose"; label21.GridColumn = 1; label21.GridRow = 9; var label22 = new Label(); label22.Text = "<arms>"; label22.GridRow = 10; var label23 = new Label(); label23.Text = "a set of tidal sleeves"; label23.GridColumn = 1; label23.GridRow = 10; var label24 = new Label(); label24.Text = "<shield>"; label24.GridRow = 11; var label25 = new Label(); label25.Text = "an intricately decorated shield"; label25.GridColumn = 1; label25.GridRow = 11; var label26 = new Label(); label26.Text = "<about body>"; label26.GridRow = 12; var label27 = new Label(); label27.Text = "a dragonwing tunic"; label27.GridColumn = 1; label27.GridRow = 12; var label28 = new Label(); label28.Text = "<waist>"; label28.GridRow = 13; var label29 = new Label(); label29.Text = "a golden belt"; label29.GridColumn = 1; label29.GridRow = 13; var label30 = new Label(); label30.Text = "<left wrist>"; label30.GridRow = 14; var label31 = new Label(); label31.Text = "tanzanite bracelet"; label31.GridColumn = 1; label31.GridRow = 14; var label32 = new Label(); label32.Text = "<right wrist>"; label32.GridRow = 15; var label33 = new Label(); label33.Text = "tanzanite bracelet"; label33.GridColumn = 1; label33.GridRow = 15; var label34 = new Label(); label34.Text = "<wielded>"; label34.GridRow = 16; var label35 = new Label(); label35.Text = "a secari dagger"; label35.GridColumn = 1; label35.GridRow = 16; var label36 = new Label(); label36.Text = "<held>"; label36.GridRow = 17; var label37 = new Label(); label37.Text = "a moss-covered pebble"; label37.GridColumn = 1; label37.GridRow = 17; _gridEquipment = new Grid(); _gridEquipment.ColumnSpacing = 8; _gridEquipment.RowSpacing = 4; _gridEquipment.DefaultColumnProportion = new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }; _gridEquipment.DefaultRowProportion = new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }; _gridEquipment.GridSelectionMode = Myra.Graphics2D.UI.GridSelectionMode.Row; _gridEquipment.GridRow = 1; _gridEquipment.Id = "_gridEquipment"; _gridEquipment.Widgets.Add(label2); _gridEquipment.Widgets.Add(label3); _gridEquipment.Widgets.Add(label4); _gridEquipment.Widgets.Add(label5); _gridEquipment.Widgets.Add(label6); _gridEquipment.Widgets.Add(label7); _gridEquipment.Widgets.Add(label8); _gridEquipment.Widgets.Add(label9); _gridEquipment.Widgets.Add(label10); _gridEquipment.Widgets.Add(label11); _gridEquipment.Widgets.Add(label12); _gridEquipment.Widgets.Add(label13); _gridEquipment.Widgets.Add(label14); _gridEquipment.Widgets.Add(label15); _gridEquipment.Widgets.Add(label16); _gridEquipment.Widgets.Add(label17); _gridEquipment.Widgets.Add(label18); _gridEquipment.Widgets.Add(label19); _gridEquipment.Widgets.Add(label20); _gridEquipment.Widgets.Add(label21); _gridEquipment.Widgets.Add(label22); _gridEquipment.Widgets.Add(label23); _gridEquipment.Widgets.Add(label24); _gridEquipment.Widgets.Add(label25); _gridEquipment.Widgets.Add(label26); _gridEquipment.Widgets.Add(label27); _gridEquipment.Widgets.Add(label28); _gridEquipment.Widgets.Add(label29); _gridEquipment.Widgets.Add(label30); _gridEquipment.Widgets.Add(label31); _gridEquipment.Widgets.Add(label32); _gridEquipment.Widgets.Add(label33); _gridEquipment.Widgets.Add(label34); _gridEquipment.Widgets.Add(label35); _gridEquipment.Widgets.Add(label36); _gridEquipment.Widgets.Add(label37); var scrollViewer1 = new ScrollViewer(); scrollViewer1.Content = _gridEquipment; var verticalStackPanel1 = new VerticalStackPanel(); verticalStackPanel1.Widgets.Add(label1); verticalStackPanel1.Widgets.Add(horizontalSeparator1); verticalStackPanel1.Widgets.Add(scrollViewer1); var verticalSeparator1 = new VerticalSeparator(); var label38 = new Label(); label38.Text = "Inventory"; _textGold = new Label(); _textGold.Text = "Gold: 50000"; _textGold.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right; _textGold.Id = "_textGold"; var panel1 = new Panel(); panel1.Widgets.Add(label38); panel1.Widgets.Add(_textGold); var horizontalSeparator2 = new HorizontalSeparator(); var label39 = new Label(); label39.Text = "iron rations(100)"; var label40 = new Label(); label40.Text = "canteen"; label40.GridRow = 1; var label41 = new Label(); label41.Text = "barrel"; label41.GridRow = 2; var label42 = new Label(); label42.Text = "short sword"; label42.GridRow = 3; var label43 = new Label(); label43.Text = "leather armor"; label43.GridRow = 4; var label44 = new Label(); label44.Text = "leather leggings"; label44.GridRow = 5; var label45 = new Label(); label45.Text = "small shield"; label45.GridRow = 6; _gridInventory = new Grid(); _gridInventory.ColumnSpacing = 8; _gridInventory.RowSpacing = 4; _gridInventory.DefaultRowProportion = new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }; _gridInventory.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); _gridInventory.GridSelectionMode = Myra.Graphics2D.UI.GridSelectionMode.Row; _gridInventory.Id = "_gridInventory"; _gridInventory.Widgets.Add(label39); _gridInventory.Widgets.Add(label40); _gridInventory.Widgets.Add(label41); _gridInventory.Widgets.Add(label42); _gridInventory.Widgets.Add(label43); _gridInventory.Widgets.Add(label44); _gridInventory.Widgets.Add(label45); var scrollViewer2 = new ScrollViewer(); scrollViewer2.Content = _gridInventory; var verticalStackPanel2 = new VerticalStackPanel(); verticalStackPanel2.Widgets.Add(panel1); verticalStackPanel2.Widgets.Add(horizontalSeparator2); verticalStackPanel2.Widgets.Add(scrollViewer2); var horizontalStackPanel1 = new HorizontalStackPanel(); horizontalStackPanel1.DefaultProportion = new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }; horizontalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); horizontalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); horizontalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); horizontalStackPanel1.Widgets.Add(verticalStackPanel1); horizontalStackPanel1.Widgets.Add(verticalSeparator1); horizontalStackPanel1.Widgets.Add(verticalStackPanel2); var horizontalSeparator3 = new HorizontalSeparator(); _buttonEquip = new TextButton(); _buttonEquip.Text = "\\c[green]E\\c[white]quip"; _buttonEquip.Width = 100; _buttonEquip.Id = "_buttonEquip"; _buttonUse = new TextButton(); _buttonUse.Text = "\\c[green]U\\c[white]se"; _buttonUse.Width = 100; _buttonUse.Id = "_buttonUse"; _buttonDrop = new TextButton(); _buttonDrop.Text = "\\c[green]D\\c[white]rop"; _buttonDrop.Width = 100; _buttonDrop.Id = "_buttonDrop"; var horizontalStackPanel2 = new HorizontalStackPanel(); horizontalStackPanel2.Spacing = 8; horizontalStackPanel2.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right; horizontalStackPanel2.Widgets.Add(_buttonEquip); horizontalStackPanel2.Widgets.Add(_buttonUse); horizontalStackPanel2.Widgets.Add(_buttonDrop); var horizontalSeparator4 = new HorizontalSeparator(); _textDescription = new Label(); _textDescription.Text = "short sword - weapon, damage: 3-8"; _textDescription.Id = "_textDescription"; var horizontalSeparator5 = new HorizontalSeparator(); _textAc = new Label(); _textAc.Text = "AC: 100"; _textAc.Id = "_textAc"; _textHitRoll = new Label(); _textHitRoll.Text = "Hit Roll: 20"; _textHitRoll.GridColumn = 1; _textHitRoll.Id = "_textHitRoll"; _textAttacks = new Label(); _textAttacks.Text = "Attacks: 4-8/6-10"; _textAttacks.GridColumn = 2; _textAttacks.Id = "_textAttacks"; var grid1 = new Grid(); grid1.ColumnSpacing = 8; grid1.RowSpacing = 8; grid1.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); grid1.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); grid1.ColumnsProportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); grid1.Widgets.Add(_textAc); grid1.Widgets.Add(_textHitRoll); grid1.Widgets.Add(_textAttacks); var verticalStackPanel3 = new VerticalStackPanel(); verticalStackPanel3.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); verticalStackPanel3.Width = 1000; verticalStackPanel3.Padding = new Thickness(0, 16); verticalStackPanel3.Widgets.Add(horizontalStackPanel1); verticalStackPanel3.Widgets.Add(horizontalSeparator3); verticalStackPanel3.Widgets.Add(horizontalStackPanel2); verticalStackPanel3.Widgets.Add(horizontalSeparator4); verticalStackPanel3.Widgets.Add(_textDescription); verticalStackPanel3.Widgets.Add(horizontalSeparator5); verticalStackPanel3.Widgets.Add(grid1); Title = "Items"; DragDirection = DragDirection.None; Left = 172; Content = verticalStackPanel3; }
private void BuildUI() { var horizontalSeparator1 = new HorizontalSeparator(); var listItem1 = new ListItem(); listItem1.Text = "Double Attack"; var listItem2 = new ListItem(); listItem2.Text = "Parry"; listItem2.Color = Color.Red; var listItem3 = new ListItem(); listItem3.Text = "Spell \'Cure Light Wounds\'"; var listItem4 = new ListItem(); listItem4.Text = "Spell \'Cure Minor Wounds\'"; var listItem5 = new ListItem(); listItem5.Text = "Spell \'Cure Normal Wounds\'"; var listItem6 = new ListItem(); listItem6.Text = "Spell \'Cure Serious Wounds\'"; _listAbilities = new ListBox(); _listAbilities.Width = 250; _listAbilities.Id = "_listAbilities"; _listAbilities.Items.Add(listItem1); _listAbilities.Items.Add(listItem2); _listAbilities.Items.Add(listItem3); _listAbilities.Items.Add(listItem4); _listAbilities.Items.Add(listItem5); _listAbilities.Items.Add(listItem6); var verticalSeparator1 = new VerticalSeparator(); _labelEnergyCost = new Label(); _labelEnergyCost.Text = "0 Energy"; _labelEnergyCost.Id = "_labelEnergyCost"; var horizontalSeparator2 = new HorizontalSeparator(); _labelType = new Label(); _labelType.Text = "On/Off"; _labelType.Id = "_labelType"; var horizontalSeparator3 = new HorizontalSeparator(); _labelDescription = new Label(); _labelDescription.Text = "Replaces first attack with parry, which is blocks first attack of enemy with almo" + "st 100% guarantee."; _labelDescription.Wrap = true; _labelDescription.Height = 200; _labelDescription.Id = "_labelDescription"; var verticalStackPanel1 = new VerticalStackPanel(); verticalStackPanel1.Spacing = 4; verticalStackPanel1.Width = 250; verticalStackPanel1.Widgets.Add(_labelEnergyCost); verticalStackPanel1.Widgets.Add(horizontalSeparator2); verticalStackPanel1.Widgets.Add(_labelType); verticalStackPanel1.Widgets.Add(horizontalSeparator3); verticalStackPanel1.Widgets.Add(_labelDescription); var horizontalStackPanel1 = new HorizontalStackPanel(); horizontalStackPanel1.Widgets.Add(_listAbilities); horizontalStackPanel1.Widgets.Add(verticalSeparator1); horizontalStackPanel1.Widgets.Add(verticalStackPanel1); var horizontalSeparator4 = new HorizontalSeparator(); _buttonUse = new TextButton(); _buttonUse.Text = "Use"; _buttonUse.Width = 100; _buttonUse.Id = "_buttonUse"; var horizontalStackPanel2 = new HorizontalStackPanel(); horizontalStackPanel2.Widgets.Add(_buttonUse); var verticalStackPanel2 = new VerticalStackPanel(); verticalStackPanel2.Widgets.Add(horizontalSeparator1); verticalStackPanel2.Widgets.Add(horizontalStackPanel1); verticalStackPanel2.Widgets.Add(horizontalSeparator4); verticalStackPanel2.Widgets.Add(horizontalStackPanel2); Title = "Abilities"; DragDirection = DragDirection.None; Left = 422; Top = 108; Width = 500; Content = verticalStackPanel2; }
private void BuildUI() { var horizontalSeparator1 = new HorizontalSeparator(); var listItem1 = new ListItem(); listItem1.Text = "leather jacket"; listItem1.Color = new Color { B = 140, G = 140, R = 140, A = 255, }; var listItem2 = new ListItem(); listItem2.Text = "leather pants"; listItem2.Color = new Color { B = 140, G = 140, R = 140, A = 255, }; var listItem3 = new ListItem(); listItem3.Text = "leather sleeves"; var listItem4 = new ListItem(); listItem4.Text = "leather cap"; var listItem5 = new ListItem(); listItem5.Text = "leather gloves"; var listItem6 = new ListItem(); listItem6.Text = "leather boots"; _listBoxRecipes = new ListBox(); _listBoxRecipes.Width = 200; _listBoxRecipes.VerticalAlignment = Myra.Graphics2D.UI.VerticalAlignment.Stretch; _listBoxRecipes.Id = "_listBoxRecipes"; _listBoxRecipes.Items.Add(listItem1); _listBoxRecipes.Items.Add(listItem2); _listBoxRecipes.Items.Add(listItem3); _listBoxRecipes.Items.Add(listItem4); _listBoxRecipes.Items.Add(listItem5); _listBoxRecipes.Items.Add(listItem6); var verticalSeparator1 = new VerticalSeparator(); _labelDescription = new Label(); _labelDescription.Text = "armor, ac: 4"; _labelDescription.Wrap = true; _labelDescription.Width = 300; _labelDescription.Id = "_labelDescription"; var horizontalSeparator2 = new HorizontalSeparator(); _labelRequires = new Label(); _labelRequires.Text = "2 Leather (3), Iron Ingot (2), 3 Steel Ingot (4), 4 Mithril Ingot (5)"; _labelRequires.Wrap = true; _labelRequires.Width = 300; _labelRequires.Id = "_labelRequires"; var verticalStackPanel1 = new VerticalStackPanel(); verticalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); verticalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel1.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Part, }); verticalStackPanel1.Widgets.Add(_labelDescription); verticalStackPanel1.Widgets.Add(horizontalSeparator2); verticalStackPanel1.Widgets.Add(_labelRequires); var horizontalStackPanel1 = new HorizontalStackPanel(); horizontalStackPanel1.Widgets.Add(_listBoxRecipes); horizontalStackPanel1.Widgets.Add(verticalSeparator1); horizontalStackPanel1.Widgets.Add(verticalStackPanel1); var horizontalSeparator3 = new HorizontalSeparator(); _buttonCreate = new TextButton(); _buttonCreate.Text = "\\c[green]C\\c[white]reate"; _buttonCreate.Width = 120; _buttonCreate.Id = "_buttonCreate"; var horizontalStackPanel2 = new HorizontalStackPanel(); horizontalStackPanel2.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right; horizontalStackPanel2.Widgets.Add(_buttonCreate); var verticalStackPanel2 = new VerticalStackPanel(); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Auto, }); verticalStackPanel2.Proportions.Add(new Proportion { Type = Myra.Graphics2D.UI.ProportionType.Fill, }); verticalStackPanel2.Widgets.Add(horizontalSeparator1); verticalStackPanel2.Widgets.Add(horizontalStackPanel1); verticalStackPanel2.Widgets.Add(horizontalSeparator3); verticalStackPanel2.Widgets.Add(horizontalStackPanel2); Title = "Crafting Bench"; Left = 421; Top = 20; Height = 500; Content = verticalStackPanel2; }