New multiimage control code allows background loading

Posted By: Team XBMC on May 14, 2009 in Site News

With the nice new background loading textures, complete with their own crossfading and so on, it made sense to rewrite the multiimage control to make use of this.  Previously the multiimage control generated however many image controls it needed and did all the fading, texture loading and sizing itself.

Now it just utilizes a single image control with <fadetime> set, and just sets the new filename when necessary.  Obviously it supports background=”true” (on the <imagepath> tag) to allow the images to load in the background.

Combined with the recently added support for static content updates, you can now do most of the background changing on different states that skins normally do with a single multiimage control, rather than having a separate control (or multiple separate controls) for each state.  Examples would be the various Aeon incarnations, Mediastream, or even PM3.HD’s homescreen.

Steps involve:

  1. Fill your container (wraplist or list) with static content.
  2. Set the <icon> tag to point to the “normal” background image you want displayed for that item (image should be outside of Textures.xpr).
  3. Set the <thumb> tag to a skin settable background images (or path of background images, or to something like Weather.Fanart etc.)
  4. Create a single multiimage control for the backdrop, using <imagepath background=”true”>ListItem.Icon</imagepath>.

Due to the “fallback” functionality of ListItem.Icon, if there is a custom background image or folder set, it’ll use it, else it’ll use the normal backdrop for that item.

As the user moves through the items in the list, the multiimage control will update the path to the current image, and you’ll get seamless transistions between the different backdrops, with no stutter due to all the image loading being done in the background.

Nicer effects and smoother navigation with far less code – what could be better!

Share on reddit


Comments are closed.


About XBMC

XBMC is a free and open source media player application developed by the XBMC Foundation, a non-profit technology consortium. XBMC is available for multiple operating-systems and hardware platforms, featuring a 10-foot user interface for use with televisions and remote controls. It allows users to play and view most videos, music, podcasts, and other digital media files from local and network storage media and the internet.