public void Draw(bool ForceDraw) { if (!Visible && CSettings.GameState != EGameState.EditTheme && !ForceDraw) { return; } STexture texture = new STexture(-1); if (!Selected) { texture = CTheme.GetSkinTexture(_Theme.TextureName); CDraw.DrawTexture(texture, Rect, Color); if (Reflection) { CDraw.DrawTextureReflection(texture, Rect, Color, Rect, ReflectionSpace, ReflectionHeight); } } else { texture = CTheme.GetSkinTexture(_Theme.STextureName); CDraw.DrawTexture(texture, Rect, SColor); if (Reflection) { CDraw.DrawTextureReflection(texture, Rect, SColor, Rect, ReflectionSpace, ReflectionHeight); } } Text.DrawRelative(Rect.X, Rect.Y); if (Reflection) { Text.DrawRelative(Rect.X, Rect.Y, ReflectionSpace, ReflectionHeight, Rect.H); } }
public void DrawGlyphReflection(char chr, float fontHeight, float x, float y, float z, SColorF color, float rspace, float rheight) { CTextureRef texture; SRectF rect; GetOrAddGlyph(chr, fontHeight).GetTextureAndRect(fontHeight, x, y, z, out texture, out rect); CDraw.DrawTextureReflection(texture, rect, color, rect, rspace, rheight); }
public void Draw(float scale, float z, bool aspect, bool ForceDraw) { STexture texture; if (_Texture.index != -1) { texture = _Texture; } else { texture = CTheme.GetSkinTexture(_Theme.TextureName); } SRectF bounds = new SRectF( Rect.X - Rect.W * (scale - 1f), Rect.Y - Rect.H * (scale - 1f), Rect.W + 2 * Rect.W * (scale - 1f), Rect.H + 2 * Rect.H * (scale - 1f), z); SRectF rect = bounds; if (aspect) { RectangleF bounds2 = new RectangleF(bounds.X, bounds.Y, bounds.W, bounds.H); RectangleF rect2 = new RectangleF(0f, 0f, texture.width, texture.height); CHelper.SetRect(bounds2, ref rect2, texture.width / texture.height, EAspect.Crop); rect.X = rect2.X; rect.Y = rect2.Y; rect.W = rect2.Width; rect.H = rect2.Height; } SColorF color = new SColorF(Color.R, Color.G, Color.B, Color.A * Alpha); if (Visible || ForceDraw || (CSettings.GameState == EGameState.EditTheme)) { CDraw.DrawTexture(texture, rect, color, bounds); if (Reflection) { CDraw.DrawTextureReflection(texture, rect, color, bounds, ReflectionSpace, ReflectionHeight); } } if (Selected && (CSettings.GameState == EGameState.EditTheme)) { CDraw.DrawColor(new SColorF(1f, 1f, 1f, 0.5f), rect); } }
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(); }