Change Background when wraplist is scrolled
#1
Hi there,

I am studying conditionals from the XBMC skinning manual.
I want to create a condition where, if the list item in my wraplist comes into focus, the background of the window changes.

The wraplist functions as I expect it to.
Here's what I have so far:

The menu item, which is supposed to "trigger" the background change:
Code:
<control type="wraplist" id="300">
            <description>Home Wraplist</description>
            <posx>0</posx>
            <posy>72</posy>
            <width>680</width>
            <height>190</height>
            <onup>300</onup>
            <ondown>300</ondown>
            <onleft>300</onleft>
            <onright>300</onright>
            <focusposition>3</focusposition>
            <scrolltime>200</scrolltime>
            <autoscroll>false</autoscroll>

            <itemlayout width="650" height="190">
                <control type="image">
                    <texture>$INFO[ListItem.Icon]</texture>
                    <width>180</width>
                    <height>180</height>
                    <posx>90</posx>
                    <posy>0</posy>
                </control>

                <control type="label">
                    <posx>250</posx>
                    <posy>50</posy>
                    <height>90</height>
                    <info>ListItem.Label</info>
                    <font>XLarge</font>
                    <textcolor>white</textcolor>
                    <align>left</align>
                </control>
            </itemlayout>

            <focusedlayout width="650" height="190">
                <control type="image">
                    <texture>$INFO[ListItem.Icon]</texture>
                    <height>180</height>
                    <width>180</width>
                    <posx>90</posx>
                    <posy>0</posy>
                </control>

                <control type="label">
                    <posx>250</posx>
                    <posy>50</posy>
                    <height>90</height>
                    <info>ListItem.Label</info>
                    <font>XLarge</font>
                    <selectedcolor>red</selectedcolor>
                    <align>left</align>

                </control>

            </focusedlayout>

         <content>
             <item id="1">
                 <description>Movies</description>
                 <label>31006</label>
                 <icon>icons/popcorn.png</icon>
                 <onclick>ActivateWindow(Video,movietitles)</onclick>
             </item>

             <item id="2">
                 <description>Music</description>
                 <label>31004</label>
                 <icon>icons/earphones.png</icon>
                 <onclick>ActivateWindow(Music)</onclick>
             </item>

             <item id="3">
                 <description>Settings</description>
                 <label>13000</label>
                 <icon>icons/earphones.png</icon>
                 <onclick>ActivateWindow(Settings)</onclick>
             </item>

        </content>
</control>   <!-- end wraplist -->

and the background control itself:
Code:
<!-- Background texture for the movie menu item control -->
<control type="image">
            <width>1280</width>
        <visible condition="Control.HasFocus(1)">true</visible>
       <texture>unnamed.png</texture>
</control>

This does not work. The background texture is visible all the time, no matter what comes into focus and goes out of it.
Reply
#2
Code:
<item id="1">
        <description>Movies</description>
        <label>31006</label>
        <icon>icons/popcorn.png</icon>
        <property name="Background">Texture.jpg</property>
        <onclick>ActivateWindow(Videos,MovieTitles)</onclick>
    </item>

Code:
<control type="image">
        <left>0</left>
        <top>0</top>
        <width>1280</width>
        <height>720</height>
        <visible>Control.HasFocus(300)</visible>
        <texture>$INFO[Container(300).ListItem.Property(Background)]</texture>
    </control>

Fixed
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#3
Code:
<!-- Background texture for the movie menu item control -->
<control type="image">
  <width>1280</width>
  <visible>Container(300).HasFocus(1)</visible>
  <texture>unnamed.png</texture>
</control>
Image
Reply
#4
Thank you both!

What does 300 refer to? Is it the unique ID for the home menu?
Pardon my ignorance.
Reply
#5
Not unique but it is the ID of the wraplist which contains the items.
Reply
#6
Thank you for your help gentlemen!
Reply

Logout Mark Read Team Forum Stats Members Help
Change Background when wraplist is scrolled0