public override void Draw(CustomSpriteBatch g) { int ScreenWidth = (int)(Constants.Width * 0.9); int ScreenHeight = (int)(Constants.Height * 0.8); float StartX = (Constants.Width - ScreenWidth) / 2; float StartY = (Constants.Height - ScreenHeight) / 2; float DrawX = StartX; float DrawY = StartY; DrawBox(g, new Vector2(DrawX, DrawY), ScreenWidth, ScreenHeight, Color.White); DrawX += 100; DrawBox(g, new Vector2(DrawX, DrawY), 100, 30, Color.Black); DrawBox(g, new Vector2(DrawX, DrawY + 30), 100, ScreenHeight - 30, Color.Blue); g.DrawStringCentered(fntArial12, "Level", new Vector2(DrawX + 50, DrawY + 15), Color.White); DrawX += 100; DrawBox(g, new Vector2(DrawX, DrawY), 200, 30, Color.Black); g.DrawStringCentered(fntArial12, "Name", new Vector2(DrawX + 100, DrawY + 15), Color.White); DrawX += 200; DrawBox(g, new Vector2(DrawX, DrawY), 100, 30, Color.Black); DrawBox(g, new Vector2(DrawX, DrawY + 30), 100, ScreenHeight - 30, Color.Blue); g.DrawStringCentered(fntArial12, "Points", new Vector2(DrawX + 50, DrawY + 15), Color.White); DrawX += 100; DrawBox(g, new Vector2(DrawX, DrawY), 100, 30, Color.Black); g.DrawStringCentered(fntArial12, "EXP", new Vector2(DrawX + 50, DrawY + 15), Color.White); DrawX += 100; DrawBox(g, new Vector2(DrawX, DrawY), (int)StartX + ScreenWidth - (int)DrawX, 30, Color.Black); DrawBox(g, new Vector2(DrawX, DrawY + 30), (int)StartX + ScreenWidth - (int)DrawX, ScreenHeight - 30, Color.Blue); g.DrawStringCentered(fntArial12, "Money", new Vector2(DrawX + 50, DrawY + 15), Color.White); DrawX = (Constants.Width - ScreenWidth) / 2; DrawY += 30; for (int P = 0; P < Owner.ListAllPlayer.Count; P++) { Player ActivePlayer = Owner.ListAllPlayer[P]; if (ActivePlayer.Team < 0 || ActivePlayer.Team >= 10) { continue; } g.DrawStringCentered(fntArial12, (P + 1).ToString(), new Vector2(DrawX + 50, DrawY + 15), Color.White); g.DrawStringCentered(fntArial12, "LV." + ActivePlayer.Level, new Vector2(DrawX + 150, DrawY + 15), Color.White); g.DrawStringCentered(fntArial12, ActivePlayer.Name, new Vector2(DrawX + 300, DrawY + 15), Color.White); g.DrawStringCentered(fntArial12, ListPlayerGains[P].Exp.ToString(), new Vector2(DrawX + 550, DrawY + 15), Color.White); g.DrawStringCentered(fntArial12, ListPlayerGains[P].Money.ToString(), new Vector2(DrawX + 650, DrawY + 15), Color.White); if (Owner.ListLocalPlayer.Contains(ActivePlayer)) { } else { } DrawY += 25; } }
public override void Draw(CustomSpriteBatch g) { float X = Constants.Width * 0.1f; float Y = Constants.Height * 0.4f; GameScreen.DrawBox(g, new Vector2(X, Y), (int)(Constants.Width * 0.8), (int)(Constants.Height * 0.1), Color.White); if (TimeSinceSaveInSeconds == 0) { g.DrawStringCentered(fntFinlanderFont, "Saving", new Vector2(Constants.Width / 2, Y + 20), Color.White); } else { g.DrawStringCentered(fntFinlanderFont, "Game Saved", new Vector2(Constants.Width / 2, Y + 20), Color.White); } }
public override void Draw(CustomSpriteBatch g) { DrawBox(g, new Vector2(LeftPanelX, PanelY), PanelWidth, PanelHeight, Color.White); float DrawY = PanelY + 5; int CurrentIndex = 0; for (int G = 0; G < ArrayGametypeCategory.Length; ++G) { DrawGametypeCategory(g, ArrayGametypeCategory[G], ref CurrentIndex, ref DrawY); } int RightPanelX = Constants.Width - LeftPanelX - PanelWidth; int RightPanelContentOffset = (int)(PanelWidth * 0.05); int RightPanelContentX = RightPanelX + RightPanelContentOffset; int RightPanelContentWidth = PanelWidth - RightPanelContentOffset - RightPanelContentOffset; int PreviewBoxY = PanelY + 10; int PreviewBoxHeight = (int)(PanelHeight * 0.4); int DescriptionBoxY = PreviewBoxY + PreviewBoxHeight + 10; int DescriptionHeight = PanelHeight - (DescriptionBoxY - PanelY) - 10; int DescriptionBoxNameOffset = (int)(RightPanelContentWidth * 0.25); int DescriptionBoxNameX = RightPanelContentX + DescriptionBoxNameOffset; int DescriptionBoxNameWidth = RightPanelContentWidth - DescriptionBoxNameOffset - DescriptionBoxNameOffset; int DescriptionBoxNameHeight = 30; DrawBox(g, new Vector2(RightPanelX, PanelY), PanelWidth, PanelHeight, Color.White); DrawBox(g, new Vector2(RightPanelContentX, PreviewBoxY), RightPanelContentWidth, PreviewBoxHeight, Color.White); DrawBox(g, new Vector2(RightPanelContentX, DescriptionBoxY), RightPanelContentWidth, DescriptionHeight, Color.White); DrawBox(g, new Vector2(DescriptionBoxNameX, DescriptionBoxY), DescriptionBoxNameWidth, 30, Color.White); g.DrawStringCentered(fntText, SelectedGametype.Name, new Vector2(DescriptionBoxNameX + DescriptionBoxNameWidth / 2, DescriptionBoxY + DescriptionBoxNameHeight / 2), Color.White); float DescriptionY = DescriptionBoxY + DescriptionBoxNameHeight; foreach (string ActiveLine in TextHelper.FitToWidth(fntText, SelectedGametype.Description, RightPanelContentWidth - 5)) { g.DrawString(fntText, ActiveLine, new Vector2(RightPanelContentX + 5, DescriptionY), Color.White); DescriptionY += 20; } GametypeScrollbar.Draw(g); }
public void Draw(CustomSpriteBatch g) { if (ButtonState == ButtonStates.Idle) { GameScreen.DrawBox(g, new Vector2(ButtonCollsionBox.X, ButtonCollsionBox.Y), ButtonCollsionBox.Width, ButtonCollsionBox.Height, Color.White); } else if (ButtonState == ButtonStates.Disabled) { GameScreen.DrawBox(g, new Vector2(ButtonCollsionBox.X, ButtonCollsionBox.Y), ButtonCollsionBox.Width, ButtonCollsionBox.Height, Color.Black); } else if (ButtonState == ButtonStates.Checked) { GameScreen.DrawBox(g, new Vector2(ButtonCollsionBox.X, ButtonCollsionBox.Y), ButtonCollsionBox.Width, ButtonCollsionBox.Height, Color.Black); } else if (ButtonState == ButtonStates.Hover) { GameScreen.DrawBox(g, new Vector2(ButtonCollsionBox.X, ButtonCollsionBox.Y), ButtonCollsionBox.Width, ButtonCollsionBox.Height, Color.Gray); } g.DrawStringCentered(fntText, Text, new Vector2(ButtonCollsionBox.X + ButtonCollsionBox.Width / 2, ButtonCollsionBox.Y + ButtonCollsionBox.Height / 2), Color.White); }
public override void Draw(CustomSpriteBatch g) { DrawBox(g, new Vector2(LeftPanelX, PanelY), PanelWidth, PanelHeight, Color.White); MapScrollbar.Draw(g); float DrawY = PanelY + 5; int CurrentIndex = 0; foreach (MapInfo ActiveMap in DicMapInfoByPath.Values) { if (CurrentIndex >= MapScrollbarValue) { g.DrawString(fntText, ActiveMap.MapName, new Vector2(LeftPanelX + 5, DrawY), Color.White); if (MouseHelper.MouseStateCurrent.X >= LeftPanelX && MouseHelper.MouseStateCurrent.X < LeftPanelX + PanelWidth && MouseHelper.MouseStateCurrent.Y >= DrawY && MouseHelper.MouseStateCurrent.Y < DrawY + 20) { g.Draw(sprPixel, new Rectangle(LeftPanelX, (int)DrawY, PanelWidth, 20), Color.FromNonPremultiplied(255, 255, 255, 127)); } DrawY += 20; } ++CurrentIndex; } int RightPanelX = Constants.Width - LeftPanelX - PanelWidth; int RightPanelContentOffset = (int)(PanelWidth * 0.05); int RightPanelContentX = RightPanelX + RightPanelContentOffset; int RightPanelContentWidth = PanelWidth - RightPanelContentOffset - RightPanelContentOffset; int PreviewBoxY = PanelY + 10; int PreviewBoxHeight = (int)(PanelHeight * 0.4); int DescriptionBoxY = PreviewBoxY + PreviewBoxHeight + 50; int DescriptionHeight = PanelHeight - (DescriptionBoxY - PanelY) - 10; int DescriptionBoxNameOffset = (int)(RightPanelContentWidth * 0.25); int DescriptionBoxNameX = RightPanelContentX + DescriptionBoxNameOffset; int DescriptionBoxNameWidth = RightPanelContentWidth - DescriptionBoxNameOffset - DescriptionBoxNameOffset; int DescriptionBoxNameHeight = 30; DrawBox(g, new Vector2(RightPanelX, PanelY), PanelWidth, PanelHeight, Color.White); DrawBox(g, new Vector2(RightPanelContentX, PreviewBoxY), RightPanelContentWidth, PreviewBoxHeight, Color.White); DrawBox(g, new Vector2(RightPanelContentX, DescriptionBoxY), RightPanelContentWidth, DescriptionHeight, Color.White); DrawBox(g, new Vector2(DescriptionBoxNameX, DescriptionBoxY), DescriptionBoxNameWidth, 30, Color.White); if (ActiveMapInfo.MapName != null) { g.DrawStringCentered(fntText, ActiveMapInfo.MapPlayers, new Vector2(DescriptionBoxNameX + DescriptionBoxNameWidth / 2, PreviewBoxY + PreviewBoxHeight + DescriptionBoxNameHeight / 2), Color.White); g.DrawStringCentered(fntText, "Size: " + ActiveMapInfo.NewMapSize.X + " x " + ActiveMapInfo.NewMapSize.Y, new Vector2(DescriptionBoxNameX + DescriptionBoxNameWidth / 2, PreviewBoxY + PreviewBoxHeight + 20 + DescriptionBoxNameHeight / 2), Color.White); g.DrawStringCentered(fntText, ActiveMapInfo.MapName, new Vector2(DescriptionBoxNameX + DescriptionBoxNameWidth / 2, DescriptionBoxY + DescriptionBoxNameHeight / 2), Color.White); float DescriptionY = DescriptionBoxY + DescriptionBoxNameHeight; foreach (string ActiveLine in TextHelper.FitToWidth(fntText, ActiveMapInfo.MapDescription, RightPanelContentWidth - 5)) { g.DrawString(fntText, ActiveLine, new Vector2(RightPanelContentX + 5, DescriptionY), Color.White); DescriptionY += 20; } } }