public override void InternalDraw(UISpriteBatch batch) { base.InternalDraw(batch); DrawLocalTexture(batch, TitleTex, new Rectangle(0, 0, 45, 45), new Vector2(210, 0), Vector2.One, UIStyle.Current.Bg); DrawLocalTexture(batch, TextureGenerator.GetPxWhite(batch.GraphicsDevice), null, new Vector2(255, 0), new Vector2(Size.X - (210 + 90), 45), UIStyle.Current.Bg); DrawLocalTexture(batch, TitleTex, new Rectangle(45, 0, 45, 45), new Vector2(Size.X - 45, 0), Vector2.One, UIStyle.Current.Bg); DrawLocalTexture(batch, TextureGenerator.GetPxWhite(batch.GraphicsDevice), null, new Vector2(210, 45), new Vector2(Size.X, Size.Y - 45), UIStyle.Current.TitleBg); DrawLocalTexture(batch, ThumbTex, null, new Vector2(0, FullHeight - 200), Vector2.One, UIStyle.Current.TitleBg * ((255 - TitleAd.CaptionStyle.Color.A) / 255f)); var targSize = 180f; float scale = 1f; Texture2D thumb = null; if (Thumb3D != null) { Thumb3D.Draw(); thumb = Thumb3D.Tex; } else if (Thumbnail != null) { scale = targSize / (float)Math.Sqrt(Thumbnail.Width * Thumbnail.Width + Thumbnail.Height * Thumbnail.Height); thumb = Thumbnail; } if (thumb != null) { var pos = new Vector2(thumb.Width * scale - 200, thumb.Height * scale - (FullHeight - 100) * 2) / -2; DrawLocalTexture(batch, thumb, null, pos, new Vector2(scale)); } }
public override void PreDraw(UISpriteBatch batch) { if (!Visible) { return; } base.PreDraw(batch); Thumb3D?.Draw(); }