Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Loading images from skins

    We are creating a custom skin to match our corporate look and feel. One of the things we would like to do is to be able to load images from the skin. For example:

    Code:
    canvas.setBackgroundImage("backImage.jpg");
    or

    Code:
    Img logo = new Img( "logo.png", 267, 35 );
    But instead of having the images load from /images, have them load from the skin, i.e. /app/sc/skins/MySkin/images.

    Any suggestions on how to do this? Is there a way to get the path to the skin from code?

    Thanks!

    #2
    Use the "[SKIN]" or "[SKINIMG]" prefix when specifying the URL to the image file - see the Skinning overview for how these resolve.

    Comment


      #3
      Thanks, that works. For instance:

      Code:
      canvas.setBackgroundImage("[SKIN]/backImage.jpg");

      Comment

      Working...
      X