public override void Draw(RenderTarget rt) { RectangleShape bgOverlay = new RectangleShape(new Vector2f(GameOptions.Width, GameOptions.Height)) { FillColor = Color.Black }; rt.Draw(bgOverlay); Text title = new Text("Game Over", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, 48.0f), CharacterSize = 48, Color = Color.White }; title.Center(); title.Round(); rt.Draw(title); Text winnerTitle = new Text(GetWinnerText(), Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, GameOptions.Height / 2.0f), CharacterSize = 48, Color = Color.White }; winnerTitle.Center(); winnerTitle.Round(); rt.Draw(winnerTitle); base.Draw(rt); }
public override void Draw(RenderTarget rt) { Text title = new Text("Oh no! Something went wrong!", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, 48.0f), CharacterSize = 48, Color = Color.White }; title.Center(); title.Round(); rt.Draw(title); Text blackCardText = new Text(value, Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, GameOptions.Height / 2.0f), CharacterSize = 36, Color = Color.White }; blackCardText.Center(); blackCardText.Round(); rt.Draw(blackCardText); base.Draw(rt); }
public override void Draw(RenderTarget rt) { RectangleShape overylay = new RectangleShape(new Vector2f(GameOptions.Width, GameOptions.Height)) { FillColor = new Color(0, 0, 0, 128) }; rt.Draw(overylay); RectangleShape window = new RectangleShape(new Vector2f(GameOptions.Width * (1.0f - PaddingHorizontal * 2.0f), GameOptions.Height * (1.0f - PaddingVertical * 2.0f))) { Position = new Vector2f(GameOptions.Width * PaddingHorizontal, GameOptions.Height * PaddingVertical), FillColor = Color.White, OutlineColor = Color.Black, OutlineThickness = 2.0f }; rt.Draw(window); Text labelSettings = new Text("Join by IP", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, GameOptions.Height * PaddingVertical + 48.0f), Color = Color.Black, CharacterSize = 32 }; labelSettings.Center(); labelSettings.Round(); rt.Draw(labelSettings); base.Draw(rt); }
public override void Draw(RenderTarget rt) { RectangleShape overylay = new RectangleShape(new Vector2f(GameOptions.Width, GameOptions.Height)) { FillColor = new Color(0, 0, 0, 128) }; rt.Draw(overylay); RectangleShape window = new RectangleShape(new Vector2f(GameOptions.Width * (1.0f - PaddingHorizontal * 2.0f), GameOptions.Height * (1.0f - PaddingVertical * 2.0f))) { Position = new Vector2f(GameOptions.Width * PaddingHorizontal, GameOptions.Height * PaddingVertical), FillColor = Color.White, OutlineColor = Color.Black, OutlineThickness = 2.0f }; rt.Draw(window); Text labelSettings = new Text("Host Settings", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, GameOptions.Height * (PaddingVertical * 3.0f)), Color = Color.Black, CharacterSize = 48 }; labelSettings.Center(); labelSettings.Round(); rt.Draw(labelSettings); // boundingY + 64.0f + 80.0f Text labelDecks = new Text("Decks", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, GameOptions.Height * (PaddingVertical * 3.0f) + 64.0f + 80.0f + 40.0f), Color = Color.Black, CharacterSize = 36 }; labelDecks.Center(); labelDecks.Round(); rt.Draw(labelDecks); Text portLabel = new Text("Hosts should forward port 1890 to allow players to connect over the internet.", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, GameOptions.Height * (1.0f - PaddingVertical * 2.0f) + GameOptions.Height * PaddingVertical - 20.0f), CharacterSize = 16, Color = Color.Black }; portLabel.Center(); portLabel.Round(); rt.Draw(portLabel); base.Draw(rt); }
public override void Draw(RenderTarget rt) { // Draw header rt.Draw(new RectangleShape(new Vector2f(GameOptions.Width, 350.0f)) { FillColor = Color.Black }); // GameOptions.Width / 6.0f Sprite logoSprite = new Sprite(Assets.LoadTexture("Logo.png")) { Position = new Vector2f(128.0f, (350.0f - 256.0f) / 2.0f) }; rt.Draw(logoSprite); Text sloganText = new Text("A free party game for\n" + personValue, Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(128.0f, (350 - 256) / 2.0f + 189.0f), Color = Color.White, CharacterSize = 26, Style = Text.Styles.Bold }; sloganText.Round(); rt.Draw(sloganText); // Draw version and anti-sue-hammer strings Text versionText = new Text("Version " + Program.Version, Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width - 16.0f, GameOptions.Height - 32.0f), CharacterSize = 16, Color = Color.Black }; versionText.Position -= new Vector2f(versionText.GetLocalBounds().Width, 0.0f); versionText.Round(); rt.Draw(versionText); Text originalText = new Text("A shameless rip-off of \"Cards Against Humanity\".", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(16.0f, GameOptions.Height - 32.0f), CharacterSize = 16, Color = Color.Black }; originalText.Round(); rt.Draw(originalText); base.Draw(rt); }
public override void Draw(RenderTarget rt) { RectangleShape bgColor = new RectangleShape(new Vector2f(GameOptions.Width, GameOptions.Height)) { FillColor = new Color(0, 0, 0, 128) }; rt.Draw(bgColor); Text title = new Text(winnerName + " won!", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, 48.0f), CharacterSize = 48, Color = Color.White }; title.Center(); title.Round(); title.Position += new Vector2f(1, 1); title.Color = Color.Black; rt.Draw(title); title.Position -= new Vector2f(1, 1); title.Color = Color.White; rt.Draw(title); Text blackCardText = GameUtility.Wrap(winnerCombo, Assets.LoadFont(Program.DefaultFont), 36, GameOptions.Width * 0.6f); blackCardText.Position = new Vector2f(GameOptions.Width / 2.0f, GameOptions.Height / 2.0f - 128.0f); blackCardText.CharacterSize = 36; blackCardText.Color = Color.White; blackCardText.Center(); blackCardText.Origin = new Vector2f(blackCardText.Origin.X, 0.0f); blackCardText.Round(); blackCardText.Position += new Vector2f(1, 1); blackCardText.Color = Color.Black; rt.Draw(blackCardText); blackCardText.Position -= new Vector2f(1, 1); blackCardText.Color = Color.White; rt.Draw(blackCardText); base.Draw(rt); }
public override void Draw(RenderTarget rt) { RectangleShape bgOverlay = new RectangleShape(new Vector2f(GameOptions.Width, GameOptions.Height)) { FillColor = new Color(0, 0, 0, 128) }; rt.Draw(bgOverlay); Text title = new Text(isCzar ? "Select a Champion" : "Cards on the Table", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, 48.0f), CharacterSize = 48, Color = Color.White }; title.Center(); title.Round(); title.Position += new Vector2f(1, 1); title.Color = Color.Black; rt.Draw(title); title.Position -= new Vector2f(1, 1); title.Color = Color.White; rt.Draw(title); Text blackCardText = GameUtility.Wrap(Client.CurrentBlackCard.Info.Value, Assets.LoadFont(Program.DefaultFont), 24, GameOptions.Width / 2.0f); blackCardText.Position = new Vector2f(GameOptions.Width / 2.0f, 48.0f + 16.0f); blackCardText.CharacterSize = 24; blackCardText.Color = Color.White; blackCardText.Center(); blackCardText.Origin = new Vector2f(blackCardText.Origin.X, 0.0f); blackCardText.Round(); blackCardText.Position += new Vector2f(1, 1); blackCardText.Color = Color.Black; rt.Draw(blackCardText); blackCardText.Position -= new Vector2f(1, 1); blackCardText.Color = Color.White; rt.Draw(blackCardText); base.Draw(rt); }
public override void Draw(RenderTarget rt) { RectangleShape checkbox = new RectangleShape(Size) { Position = Position, FillColor = Color.Black, }; rt.Draw(checkbox); if (mouseIn) { RectangleShape checkboxHover = new RectangleShape(new Vector2f(48.0f - 8.0f, 48.0f - 8.0f)) { Position = Position + new Vector2f(4f, 4f), FillColor = Color.Black, OutlineColor = Color.White, OutlineThickness = 2f }; rt.Draw(checkboxHover); } Text labelText = new Text(Label, Assets.LoadFont(Program.DefaultFont)) { Position = Position + new Vector2f(48.0f + 16.0f, 24.0f + 2.0f), CharacterSize = 32, Color = Color.Black }; labelText.Center(false); labelText.Round(); rt.Draw(labelText); if (Value) { RectangleShape x1 = new RectangleShape(new Vector2f(48.0f, 3.0f)) { Position = Position + new Vector2f(24.0f, 24.0f), Origin = new Vector2f(24.0f, 2.0f), FillColor = Color.White, Rotation = -45.0f }; rt.Draw(x1); RectangleShape x2 = new RectangleShape(new Vector2f(48.0f, 3.0f)) { Position = Position + new Vector2f(24.0f, 24.0f), Origin = new Vector2f(24.0f, 2.0f), FillColor = Color.White, Rotation = 45.0f }; rt.Draw(x2); /*RectangleShape legLine = new RectangleShape(new Vector2f(2.0f, 38.0f)); legLine.Position = Position + new Vector2f(39.0f, 7.0f); legLine.FillColor = Color.White; legLine.Rotation = 35.0f; rt.Draw(legLine); RectangleShape footLine = new RectangleShape(new Vector2f(2.0f, 14.0f)); footLine.Position = Position + new Vector2f(8.0f, 30.0f); footLine.FillColor = Color.White; footLine.Rotation = -45.0f; rt.Draw(footLine);*/ /*Text check = new Text("X", Assets.LoadFont(Program.DefaultFont)) { Position = Position + Size / 2.0f, CharacterSize = 48, Color = Color.White }; check.Center(); check.Round(); rt.Draw(check);*/ } base.Draw(rt); }
public override void Draw(RenderTarget rt) { // Display connecting message if needed if (!Client.Connected) { RectangleShape bgShape = new RectangleShape(new Vector2f(GameOptions.Width, GameOptions.Height)) { FillColor = Color.Black }; rt.Draw(bgShape); Text waitingText = new Text("Connecting", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, GameOptions.Height / 2.0f), CharacterSize = 48, Color = Color.White }; waitingText.Center(); waitingText.Round(); rt.Draw(waitingText); return; } // Draw lobby text Text lobbyText = new Text("Lobby", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, 48.0f), CharacterSize = 48, Color = Color.Black }; lobbyText.Center(); lobbyText.Round(); rt.Draw(lobbyText); // Draw chat area RectangleShape chatArea = new RectangleShape( new Vector2f((GameOptions.Width / 3.0f) * 2.0f - 64.0f, (GameOptions.Height / 3.0f) * 2.0f + 64.0f)) { Position = new Vector2f(GameOptions.Width / 3.0f, GameOptions.Height / 3.0f - 128.0f), FillColor = new Color(96, 96, 96, 255) }; rt.Draw(chatArea); RectangleShape chatBarArea = new RectangleShape(new Vector2f((GameOptions.Width / 3.0f) * 2.0f - 64.0f, 48.0f)) { Position = new Vector2f(GameOptions.Width / 3.0f, GameOptions.Height - 64.0f - 48.0f), FillColor = Color.Black }; rt.Draw(chatBarArea); Text messageText = new Text(chatValue + "|", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 3.0f + 8.0f, GameOptions.Height - 64.0f - 48.0f + 8.0f + 4.0f), CharacterSize = 22, Color = Color.White }; rt.Draw(messageText); // Draw chat backlog float y = 0.0f; for (int i = ChatBacklog.Count - 1; i > ChatBacklog.Count - ChatBacklogItems && i != -1; --i) { Text itemText = new Text(ChatBacklog[i], Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f((float)Math.Floor(GameOptions.Width / 3.0f + 8.0f), GameOptions.Height - 144.0f + y), CharacterSize = 22, Color = Color.White }; y -= 24.0f; rt.Draw(itemText); } base.Draw(rt); }
public override void Draw(RenderTarget rt) { RectangleShape button = new RectangleShape(new Vector2f(ButtonWidth, ButtonHeight)) { Position = Position, FillColor = Color.Black }; rt.Draw(button); // Hover if (mouseIn) { RectangleShape buttonHover = new RectangleShape(new Vector2f(ButtonWidth - 8, ButtonHeight - 8)) { Position = Position + new Vector2f(4f, 4f), FillColor = Color.Black, OutlineColor = Color.White, OutlineThickness = 2f }; rt.Draw(buttonHover); } Text text = new Text(value, Assets.LoadFont(Program.DefaultFont)) { Position = Position + Size / 2.0f, CharacterSize = 18 }; text.Center(); text.Round(); rt.Draw(text); base.Draw(rt); }
public override void Draw(RenderTarget rt) { RectangleShape checkbox = new RectangleShape(Size) { Position = Position, FillColor = Color.Black, }; rt.Draw(checkbox); if (mouseIn) { RectangleShape checkboxHover = new RectangleShape(new Vector2f(48.0f - 8.0f, 48.0f - 8.0f)) { Position = Position + new Vector2f(4.0f, 4.0f), FillColor = Color.Black, OutlineColor = Color.White, OutlineThickness = 2f }; rt.Draw(checkboxHover); } Text labelText = new Text(Label, Assets.LoadFont(Program.DefaultFont)) { Position = Position + new Vector2f(48.0f + 16.0f, 24.0f + 2.0f), CharacterSize = 32, Color = Color.Black }; labelText.Center(false); labelText.Round(); rt.Draw(labelText); if (Value) { RectangleShape x1 = new RectangleShape(new Vector2f(48.0f, 3.0f)) { Position = Position + new Vector2f(24.0f, 24.0f), Origin = new Vector2f(24.0f, 2.0f), FillColor = Color.White, Rotation = -45.0f }; rt.Draw(x1); RectangleShape x2 = new RectangleShape(new Vector2f(48.0f, 3.0f)) { Position = Position + new Vector2f(24.0f, 24.0f), Origin = new Vector2f(24.0f, 2.0f), FillColor = Color.White, Rotation = 45.0f }; rt.Draw(x2); } base.Draw(rt); }
public override void Draw(RenderTarget rt) { RectangleShape numberbox = new RectangleShape(Size) { Position = Position, FillColor = Color.Black, }; rt.Draw(numberbox); if (mouseIn) { RectangleShape checkboxHover = new RectangleShape(new Vector2f(64.0f - 8.0f, 48.0f - 8.0f)) { Position = Position + new Vector2f(4f, 4f), FillColor = Color.Black, OutlineColor = Color.White, OutlineThickness = 2f }; rt.Draw(checkboxHover); } Text valueText = new Text(stringValue, Assets.LoadFont(Program.DefaultFont)) { Position = Position + new Vector2f(8.0f, 8.0f), CharacterSize = 28, Color = Color.White }; valueText.Round(); rt.Draw(valueText); if (Selected && cursorVisible) { RectangleShape cursor = new RectangleShape(new Vector2f(2.0f, Size.Y - 16.0f)) { Position = Position + new Vector2f(valueText.GetWidth() + 8.0f + 2.0f, 8.0f), FillColor = Color.White }; cursor.Round(); rt.Draw(cursor); } Text labelText = new Text(label, Assets.LoadFont(Program.DefaultFont)) { Position = Position + new Vector2f(64.0f + 16.0f, 24.0f + 2.0f), CharacterSize = 32, Color = Color.Black }; labelText.Center(false); labelText.Round(); rt.Draw(labelText); }
public override void Draw(RenderTarget rt) { RectangleShape overylay = new RectangleShape(new Vector2f(GameOptions.Width, GameOptions.Height)) { FillColor = new Color(0, 0, 0, 128) }; rt.Draw(overylay); RectangleShape window = new RectangleShape(new Vector2f(GameOptions.Width * (1.0f - PaddingHorizontal * 2.0f), GameOptions.Height * (1.0f - PaddingVertical * 2.0f))) { Position = new Vector2f(GameOptions.Width * PaddingHorizontal, GameOptions.Height * PaddingVertical), FillColor = Color.White, OutlineColor = Color.Black, OutlineThickness = 2.0f }; rt.Draw(window); Text labelSettings = new Text("Server List", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(GameOptions.Width / 2.0f, GameOptions.Height * (PaddingVertical * 3.0f)), Color = Color.Black, CharacterSize = 48 }; labelSettings.Center(); labelSettings.Round(); rt.Draw(labelSettings); if (servers.Count == 0) { Text serverLabel = new Text(refreshing ? "Refreshing!" : "No servers found!", Assets.LoadFont(Program.DefaultFont), 36) { Position = new Vector2f(GameOptions.Width / 2.0f, GameOptions.Height / 2.0f), Color = Color.Black }; serverLabel.Center(); serverLabel.Round(); rt.Draw(serverLabel); } else { float boundingY = GameOptions.Height * (PaddingVertical * 3.0f) + 64.0f; float boundingX = GameOptions.Width * (PaddingHorizontal * 2.5f); float yy = 0.0f; bool lightGray = true; for (int i = listOffset; i < listOffset + 6; ++i) { // Draw backing RectangleShape backing = new RectangleShape(new Vector2f(GameOptions.Width - boundingX * 2.0f, 64.0f)) { Position = new Vector2f(boundingX, boundingY + (i - listOffset) * 64.0f), FillColor = lightGray ? new Color(192, 192, 192) : new Color(128, 128, 128) }; if (i == selectedIndex) backing.FillColor = new Color(100, 149, 237); rt.Draw(backing); lightGray = !lightGray; // Draw server name if (i >= servers.Count) continue; Server server = servers[i]; Text serverLabel = new Text(server.Name, Assets.LoadFont(Program.DefaultFont), 36) { Position = new Vector2f(boundingX + 12.0f, boundingY + yy + 32.0f), Color = Color.White }; serverLabel.Center(false); serverLabel.Round(); rt.Draw(serverLabel); // Draw player count Sprite playerAvatar = new Sprite(Assets.LoadTexture("Avatar.png")) { Position = new Vector2f(boundingX + GameOptions.Width - boundingX * 2.0f - 128.0f, boundingY + yy + 32.0f), Scale = new Vector2f(0.5f, 0.5f) }; playerAvatar.Origin = new Vector2f(playerAvatar.TextureRect.Width / 2.0f, playerAvatar.TextureRect.Height / 2.0f); rt.Draw(playerAvatar); Text playerCountLabel = new Text(server.PlayerCount.ToString("G") + "/" + Constants.MaxPlayerCount.ToString("G"), Assets.LoadFont(Program.DefaultFont), 36) { Position = new Vector2f(boundingX + GameOptions.Width - boundingX * 2.0f - 128.0f + 32.0f, boundingY + yy + 32.0f), Color = Color.White }; playerCountLabel.Center(false); playerCountLabel.Round(); rt.Draw(playerCountLabel); yy += 64.0f; } } base.Draw(rt); }
public override void Draw(RenderTarget rt) { RectangleShape barArea = new RectangleShape(Size) { Position = Position, FillColor = Color.Black }; rt.Draw(barArea); Text labelText = new Text(label, Assets.LoadFont(Program.DefaultFont)) { Position = Position + new Vector2f(16.0f, -24.0f), CharacterSize = 18, Color = Color.Black }; labelText.Round(); rt.Draw(labelText); Text messageText = new Text(Value, Assets.LoadFont(Program.DefaultFont)) { Position = Position + new Vector2f(8.0f, 8.0f), CharacterSize = 28, Color = Color.White }; messageText.Round(); rt.Draw(messageText); if (Selected && cursorVisible) { RectangleShape cursor = new RectangleShape(new Vector2f(2.0f, Size.Y - 16.0f)) { Position = Position + new Vector2f(messageText.GetGlobalBounds().Width + 8.0f + 4.0f, 8.0f), FillColor = Color.White }; cursor.Round(); rt.Draw(cursor); } base.Draw(rt); }
public override void Draw(RenderTarget rt) { if (Parent.GetType() == typeof(InGame)) { // Draw avatar Sprite avatar = new Sprite(Assets.LoadTexture("Avatar.png")) { Position = Position, Scale = new Vector2f(1.0f, 1.0f) }; avatar.Origin = new Vector2f(avatar.TextureRect.Width / 2.0f, avatar.TextureRect.Height); rt.Draw(avatar); // Draw crown if czar if (Czar) { Sprite crown = new Sprite(Assets.LoadTexture("Hat.png")) { Position = Position }; crown.Origin = new Vector2f(crown.TextureRect.Width / 2.0f, crown.TextureRect.Height); rt.Draw(crown); } Text nameText = GameUtility.Wrap(Name, Assets.LoadFont(Program.DefaultFont), 18, 128.0 + 32.0 - 8.0); nameText.Position = Position + new Vector2f(0.0f, 16.0f); nameText.CharacterSize = 18; nameText.Color = Color.Black; nameText.Center(); nameText.Round(); rt.Draw(nameText); // Draw hand if (IsLocalPlayer) { for (int i = 0; i < Client.Hand.Count; ++i) Client.Hand[i].Position = new Vector2f(i * 124 + 20, GameOptions.Height - 194 + 8); } DrawOutlineText(Score.ToString("G"), Assets.LoadFont(Program.DefaultFont), 24, new Vector2f(Position.X + 24.0f, Position.Y - 24.0f), rt); if (Thinking && !Czar) DrawOutlineText("...", Assets.LoadFont(Program.DefaultFont), 30, Position - new Vector2f(9.0f + 6.0f, 40.0f), rt); } else if (Parent.GetType() == typeof(Lobby)) { // Draw avatar Sprite avatar = new Sprite(Assets.LoadTexture("Avatar.png")) { Position = Position, Scale = new Vector2f(0.87f, 0.87f) }; rt.Draw(avatar); Text nameText = new Text(Name, Assets.LoadFont(Program.DefaultFont)) { Position = Position + new Vector2f(96.0f, 87.0f / 2.0f), CharacterSize = 36, Color = Color.Black }; nameText.Position -= new Vector2f(0.0f, nameText.GetLocalBounds().Height / 2.0f); nameText.Round(); rt.Draw(nameText); } base.Draw(rt); }
public override void Draw(RenderTarget rt) { // Outline rt.Draw(new RectangleShape(new Vector2f(GameOptions.Width - 16, GameOptions.Height - 16)) { Position = new Vector2f(8, 8), OutlineColor = Color.Black, FillColor = Color.White, OutlineThickness = 8 }); // White card table rt.Draw(new RectangleShape(new Vector2f(1264.0f, 202.0f)) { Position = new Vector2f(8.0f, GameOptions.Height - 194.0f - 16.0f), FillColor = Color.Black }); // Timer table rt.Draw(new RectangleShape(new Vector2f(256.0f, 63.0f)) { Position = new Vector2f(GameOptions.Width - 256.0f - 8.0f, 8.0f), FillColor = Color.Black }); // Table border rt.Draw(new RectangleShape(new Vector2f(8.0f, 502.0f)) { Position = new Vector2f(GameOptions.Width - 256.0f - 8.0f, 8.0f), FillColor = Color.Black }); // Timer text string timerValue = String.Format("{0}:{1}", (Client.SecondsLeft / 60).ToString("D"), (Client.SecondsLeft % 60).ToString("D").PadLeft(2, '0')); Text text = new Text(timerValue, Assets.LoadFont("QuartzMS.ttf")) { Position = new Vector2f(GameOptions.Width - 128.0f - 8.0f, 40.0f), CharacterSize = 48 }; text.Center(); text.Round(); text.Color = Color.White; rt.Draw(text); // Draw decks rt.Draw(new Sprite(Assets.LoadTexture("Decks.png")) { Position = new Vector2f(GameOptions.Width / 2.0f - 31.0f - 128.0f - 70.0f, GameOptions.Height / 2.0f - 44.0f - 89.0f - 22.0f) }); // Draw chat backlog float y = 0.0f; for (int i = ChatBacklog.Count - 1; i > ChatBacklog.Count - ChatBacklogItems && i != -1; --i) { Text itemText = new Text(ChatBacklog[i], Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(16, GameOptions.Height - 226.0f - 24.0f - 24.0f + y), CharacterSize = 22, Color = Color.Black }; y -= 24.0f; rt.Draw(itemText); } Text chatMessageText = new Text(chatValue + "|", Assets.LoadFont(Program.DefaultFont)) { Position = new Vector2f(8.0f + 6.0f, GameOptions.Height - 220.0f - 24.0f), Color = Color.Black, CharacterSize = 22 }; rt.Draw(chatMessageText); base.Draw(rt); }
public override void Draw(RenderTarget rt) { if (!Visible) return; RectangleShape button = new RectangleShape(new Vector2f(Width, Height)) { Position = Position, FillColor = Color.Black }; rt.Draw(button); // Hover if (mouseIn) { RectangleShape buttonHover = new RectangleShape(new Vector2f(Width - 8, Height - 8)) { Position = Position + new Vector2f(4.0f, 4.0f), FillColor = Color.Black, OutlineColor = Color.White, OutlineThickness = 2.0f }; rt.Draw(buttonHover); } Text text = new Text(value, Assets.LoadFont(Program.DefaultFont)) { Position = Position + Size / 2.0f, CharacterSize = 24, Style = Text.Styles.Bold }; FloatRect bounds = text.GetGlobalBounds(); text.Position -= new Vector2f(bounds.Width / 2.0f, bounds.Height / 2.0f + 4.0f); text.Round(); rt.Draw(text); base.Draw(rt); }