private void DrawText() { CalculateTextPositions(); var timeDiff = TextureManager.LastGameTime.ElapsedRealTime.TotalSeconds; if (OptionChangeActive) { _optionControlOpacity = Math.Min(255, _optionControlOpacity + (FADEIN_SPEED * timeDiff)); } else { _optionControlOpacity = Math.Max(0, _optionControlOpacity - (FADEOUT_SPEED * timeDiff)); } var playerName = (Player.Profile == null) ? "Guest" : this.Player.Profile.Name; if (Player.CPU) { playerName = "CPU"; } DrawChangeControls(); _textColor.A = (byte)(255 - _optionControlOpacity); var scale = FontManager.ScaleTextToFit(playerName, "TwoTech36", this.Width - 170, 50); FontManager.DrawString(playerName, "TwoTech36", _nameTextPosition, scale, _textColor, FontAlign.Center); }
public override void Draw() { if (Player.Profile == null) { return; } _drawColor.A = Opacity; _levelBaseSprite.Position = new Vector2(this.X, this.Y); _levelFrontSprite.Position = new Vector2(this.X, this.Y + 12); _levelBaseSprite.ColorShading.A = this.Opacity; _levelFrontSprite.ColorShading.A = this.Opacity; _levelTextPosition = new Vector2(this.X + this.Width - 3, this.Y - 15); var progress = Player.GetLevelProgressSafe(); progress = Math.Min(1, progress); _levelFrontSprite.Width = (int)(this.Width * progress); _levelFrontSprite.Draw(); _levelBaseSprite.Width = this.Width; _levelBaseSprite.Draw(); //Draw level text. var playerlevel = String.Format("{0:00}", Player.GetLevel()); var scale = FontManager.ScaleTextToFit(playerlevel, "TwoTech36", 32, 38); FontManager.DrawString(playerlevel, "TwoTech36", _levelTextPosition, scale, _drawColor, FontAlign.Right); }
private void DrawTitleDisplay() { _songTitleBase.Draw(); var textPosition = _songTitleBase.Position.Clone(); Vector2 scale; textPosition.X += 185; if (!String.IsNullOrEmpty(DisplayedSong.Title)) { scale = FontManager.ScaleTextToFit(DisplayedSong.Title, "LargeFont", 350, 100); FontManager.DrawString(DisplayedSong.Title, "LargeFont", textPosition, scale, Color.Black, FontAlign.Center); } textPosition.X += 5; textPosition.Y += 25; if (!String.IsNullOrEmpty(DisplayedSong.Subtitle)) { scale = FontManager.ScaleTextToFit(DisplayedSong.Subtitle, "DefaultFont", 360, 100); FontManager.DrawString(DisplayedSong.Subtitle, "DefaultFont", textPosition, scale, Color.Black, FontAlign.Center); } textPosition.Y += 30; if (!String.IsNullOrEmpty(DisplayedSong.Artist)) { scale = FontManager.ScaleTextToFit(DisplayedSong.Artist, "DefaultFont", 360, 100); FontManager.DrawString(DisplayedSong.Artist, "DefaultFont", textPosition, scale, Color.Black, FontAlign.Center); } }
public void DrawText() { //Draw Text var textPosition = this.Position.Clone(); textPosition += new Vector2(45, 1); Vector2 scale = FontManager.ScaleTextToFit(Song.Title, "LargeFont", _textMaxWidth, (int)this.Height); FontManager.DrawString(Song.Title, "LargeFont", textPosition, scale, _textDrawColor, FontAlign.Left); textPosition.Y += 22; scale = FontManager.ScaleTextToFit(Song.Artist, "DefaultFont", TextMaxWidth, (int)this.Height); FontManager.DrawString(Song.Artist, "DefaultFont", textPosition, scale, _textDrawColor, FontAlign.Left); }
private void DrawMenuItems(int startItem, int lastItem) { int xOptionOffset = CalculateXOptionOffset(); var position = new Vector2 { X = this.X + 10, Y = this.Y + 30 }; for (int i = startItem; i <= lastItem; i++) { MenuItem menuItem = _menuItems[i]; Color drawColor; if (IsSelected(menuItem)) { SelectedItemBackgroundColor.A = Opacity; drawColor = HighlightColor; _selectedItemSprite.ColorShading = SelectedItemBackgroundColor; _selectedItemSprite.Position = position.Clone(); _selectedItemSprite.Y += 1; _selectedItemSprite.X -= 5; _selectedItemSprite.Width = this.Width - 10; _selectedItemSprite.Height = ItemSpacing + 3; _selectedItemSprite.Draw(); } else { drawColor = TextColor; } drawColor.A = menuItem.Enabled ? Opacity : (byte)(Opacity / 2); FontManager.DrawString(menuItem.ItemText, FontName, position, drawColor, FontAlign.Left); position.X += xOptionOffset; var menuOptionText = menuItem.SelectedText(); var scale = FontManager.ScaleTextToFit(menuOptionText, FontName, (int)this.Width - 20 - xOptionOffset, 1000); FontManager.DrawString(menuOptionText, FontName, position, scale, drawColor, FontAlign.Left); position.X -= xOptionOffset; position.Y += ItemSpacing; } }
public override void Draw() { var shortPath = CurrentFolder; var position = this.Position; position.X += 5; var pathWidth = FontManager.ScaleTextToFit(shortPath, "LargeFont", (int)this.Width - 10, 50); FontManager.DrawString(shortPath, "LargeFont", position, pathWidth, Color.Black, FontAlign.Left); FileList.X = this.X; FileList.Y = this.Y + 35; FileList.Width = this.Width; FileList.Draw(); DrawControlHelp(); }