public PlayerView(Vector2u displaySize) : base(displaySize) { BackgroundColor = new Color(40,40,40); playerBox = new GroupBox(GuiCanvas); playerBox.SetBounds(20, 20, displaySize.X - 40, displaySize.Y - 40); playerNameLabel = new GroupBox(playerBox); playerNameLabel.SetBounds(20, 20, 256, 32); }
public Screen_Combat(Base parent) : base(parent) { SetSize(parent.Width, parent.Height); imgCombatMap = new Gwen.Control.ImagePanel(this); tacticState.New(ref seed); ShipsCounter.ShipsCount(ref seed); pictureMap.Width = Program.percentW(100); pictureMap.Height = Program.percentH(82); tacticDraw.New(pictureMap, seed, tacticState); UpdateDrawing(); imgCombatMap.SetPosition(Program.percentW(0), Program.percentH(0)); imgCombatMap.SetSize(pictureMap.Width, pictureMap.Height); imgCombatMap.MouseDown += new GwenEventHandler <ClickedEventArgs>(imgCombatMap_MouseDown); buttonStep = new Gwen.Control.Button(this); buttonStep.Text = "Step"; buttonStep.Font = Program.fontButtonLabels; buttonStep.SetBounds(Program.percentW(82), Program.percentH(82), Program.percentW(18), Program.percentH(6)); buttonStep.Clicked += onStepClick; buttonConcede = new Gwen.Control.Button(this); buttonConcede.Text = "Concede"; buttonConcede.Font = Program.fontButtonLabels; buttonConcede.SetBounds(Program.percentW(82), Program.percentH(88), Program.percentW(18), Program.percentH(6)); buttonConcede.Clicked += onConcedeClick; buttonAutoBattle = new Gwen.Control.Button(this); buttonAutoBattle.Text = "Auto Battle"; buttonAutoBattle.Font = Program.fontButtonLabels; buttonAutoBattle.SetBounds(Program.percentW(82), Program.percentH(94), Program.percentW(18), Program.percentH(6)); buttonAutoBattle.Clicked += onAutoBattleClick; labelStep = new Gwen.Control.Label(this); labelStep.Text = "Ходит 1-й игрок"; labelStep.Font = Program.fontText; labelStep.TextColor = Color.GreenYellow; labelStep.SetBounds(Program.percentW(65), Program.percentH(90), Program.percentW(20), Program.percentH(8)); labelDescription = new Gwen.Control.Label(this); labelDescription.Text = ""; labelDescription.Font = Program.fontText; labelDescription.TextColor = Color.GreenYellow; labelDescription.SetBounds(Program.percentW(0), Program.percentH(82), Program.percentW(50), Program.percentH(18)); }
private void EndCombat(int win) { Gwen.Control.WindowControl windowEnd = new Gwen.Control.WindowControl(this); windowEnd.Width = this.Width / 2; windowEnd.Height = this.Height / 2; windowEnd.SetPosition(this.Width / 2 - windowEnd.Width / 2, this.Height / 2 - windowEnd.Height / 2); Gwen.Control.Label labelWin = new Gwen.Control.Label(windowEnd); labelWin.Text = "Win Player " + win.ToString(); labelWin.Font = Program.fontLogo; labelWin.SetBounds(windowEnd.Width / 2 - labelWin.Width / 2, windowEnd.Height / 2 - labelWin.Height, windowEnd.Width, windowEnd.Height * 15 / 100); Gwen.Control.Button buttonOK = new Gwen.Control.Button(windowEnd); buttonOK.Text = "OK"; buttonOK.Font = Program.fontButtonLabels; buttonOK.SetBounds(windowEnd.Width / 2 - buttonOK.Width / 2, windowEnd.Height * 70 / 100, windowEnd.Width * 25 / 100, windowEnd.Height * 15 / 100); buttonOK.Clicked += onOKClick; windowEnd.IsClosable = false; }