private void _DrawTileArtistTexts() { int i = 0; foreach (CText text in _Artists) { if (i < _Covers.Count && _Covers[i].Selected) { _DrawSelectedTileArtistText(text); } else if (i < _Covers.Count) { CText drawtext = new CText(text); drawtext.Color.A = 0.5f; drawtext.X = MaxRect.X + _TileCoverW + _TileTextIndent; drawtext.Y -= _ListDragDiffY; drawtext.Draw(); } else { text.Text = ""; } i++; } }
private void _DrawSelectedTileText(CText text, float scaleFactor, EStyle style) { CText ScaledText = _ScaleText(text, scaleFactor, style); ScaledText.Color.A = 1f; float X = MaxRect.X - (MaxRect.W * (SelectedTileZoomFactor - 1) / 2); X += (_TileCoverW + _TileTextIndent) * SelectedTileZoomFactor; ScaledText.X = (float)Math.Round(X); ScaledText.Y -= _ListDragDiffY; ScaledText.Draw(); }
private void _DrawTileSongTitleTexts() { int i = 0; foreach (CText text in _Titles) { if (i < _Covers.Count && _Covers[i].Selected) { _DrawSelectedTileTitleText(text); } else if (i < _Covers.Count) { CText drawtext = new CText(text); drawtext.Color.A = 0.5f; drawtext.Y -= _ListDragDiffY; drawtext.Draw(); } else { text.Text = ""; } i++; } }
public override void Draw() { foreach (CStatic tile in _Tiles) { if (tile.Selected && _Active) { tile.Draw(1.2f, tile.Rect.Z - 0.1f, EAspect.Crop, false); } else { if (tile.Texture.index != _CoverTexture.index) { tile.Draw(1f, tile.Rect.Z, EAspect.Crop, false); } else { tile.Draw(1f, tile.Rect.Z, EAspect.Stretch, false); } } } if (CSongs.Category >= 0) { int actsong = _PreviewSelected; if ((CSongs.NumVisibleSongs > actsong) && (actsong >= 0)) { CSong song = CSongs.VisibleSongs[actsong]; _CoverBig.Texture = song.CoverTextureSmall; _Artist.Text = song.Artist; _Title.Text = song.Title; _DuetIcon.Visible = song.IsDuet; _VideoIcon.Visible = song.VideoFileName.Length > 0; _MedleyCalcIcon.Visible = song.Medley.Source == EMedleySource.Calculated; _MedleyTagIcon.Visible = song.Medley.Source == EMedleySource.Tag; float Time = CSound.GetLength(_SongStream); if (song.Finish != 0) { Time = song.Finish; } Time -= song.Start; int min = (int)Math.Floor(Time / 60f); int sec = (int)(Time - min * 60f); _SongLength.Text = min.ToString("00") + ":" + sec.ToString("00"); } } else { int actcat = _PreviewSelected; if ((CSongs.NumCategories > actcat) && (actcat >= 0)) { _CoverBig.Texture = CSongs.Categories[actcat].CoverTextureSmall; _Artist.Text = CSongs.Categories[actcat].Name; int num = CSongs.NumSongsInCategory(actcat); if (num != 1) { _Title.Text = CLanguage.Translate("TR_SCREENSONG_NUMSONGS").Replace("%v", num.ToString()); } else { _Title.Text = CLanguage.Translate("TR_SCREENSONG_NUMSONG").Replace("%v", num.ToString()); } _SongLength.Text = String.Empty; _DuetIcon.Visible = false; _VideoIcon.Visible = false; _MedleyCalcIcon.Visible = false; _MedleyTagIcon.Visible = false; } } _TextBG.Draw(); _CoverBig.Draw(1f, EAspect.Crop); if (_vidtex.color.A < 1) { _CoverBig.Draw(1f, EAspect.Crop); } if (_vidtex.index != -1 && _Video != -1) { RectangleF bounds = new RectangleF(_CoverBig.Rect.X, _CoverBig.Rect.Y, _CoverBig.Rect.W, _CoverBig.Rect.H); RectangleF rect = new RectangleF(0f, 0f, _vidtex.width, _vidtex.height); CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop); CDraw.DrawTexture(_vidtex, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z), _vidtex.color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f), false); CDraw.DrawTextureReflection(_vidtex, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z), _vidtex.color, new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f), _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight); } _Artist.Draw(); _Title.Draw(); _SongLength.Draw(); _DuetIcon.Draw(); _VideoIcon.Draw(); _MedleyCalcIcon.Draw(); _MedleyTagIcon.Draw(); }