[Music] Rewrite GUIMusicInfo.cs for better skinning ability (1 Viewer)

pilehave

Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    Hi

    Currently the code renders music covers with Util.Picture.RenderImage() which means that the cover is rendered on top of any other graphics in the skin. You cannot put the cover behind transparent graphics or anything like that (or even animate it).

    GUIVideoInfo.cs does it correctly, so this approach would be appreciated. Also, GUIMusicInfo.cs uses a cover grabbed from Amazon, despite the fact that a cover already exists (and this cover is used on every other music-related screen!).

    The code is this part:

    Code:
          if (null != imgCoverArt)
          {
            float x = (float) imgCoverArt.XPosition;
            float y = (float) imgCoverArt.YPosition;
            int width;
            int height;
            GUIGraphicsContext.Correct(ref x, ref y);
    
            int maxWidth = imgCoverArt.Width;
            int maxHeight = imgCoverArt.Height;
            GUIGraphicsContext.GetOutputRect(coverArtTextureWidth, coverArtTextureHeight, maxWidth, maxHeight, out width,
                                             out height);
    
            GUIFontManager.Present();
            Util.Picture.RenderImage(coverArtTexture, (int) x, (int) y, width, height, coverArtTextureWidth,
                                     coverArtTextureHeight, 0, 0, true);
          }

    I tried correcting it myself, but it was more complicated than I thought...
     

    Users who are viewing this thread

    Top Bottom