Quantcast
Channel: Kodi Community Forum - Skinning
Viewing all articles
Browse latest Browse all 1803

wraplist control animation - condition to check if moving forward or backwards

$
0
0
I'm trying out some animation in a WrapList control and in this I have <itemlayout> smaller than <focusedlayout>. My focused item stays in center in this and is zoomed in. I've setup delay, start, end position for the animation and it all looks good and smooth ONLY if I am going forward.

The problem is when I'm going backwards - then the animation start and end make the animation jarring (jerky/jumpy). I think if I can add a condition to the animation so that I can choose different start and end position when going forward vs when going backwards then I can achieve smooth motion in both direction.

Can someone please advice on how to check if I am going forward or backwards in a wraplist.

Here is my code:

          <control type="wraplist" id="120"> <!-- Icon and Title -->
                    <viewtype label="3D list">list</viewtype>
                    <orientation>horizontal</orientation>
                    <pagecontrol>25</pagecontrol>
                    <focusposition>3</focusposition>
                    <autoscroll>false</autoscroll>
               <left>60</left>
               <top>290</top>
               <width>1210</width>
               <height>420</height>
               <onleft>2051</onleft>
               <onright>60</onright>
               <onup>52</onup>
               <ondown>52</ondown>
               <scrolltime tween="Quadratic" easing="in">250</scrolltime>
               <preloaditems>10</preloaditems>
               <pagecontrol>60</pagecontrol>
               <itemlayout height="340" width="164">
                    <control type="image"> <!-- thumbnail -->
                         <left>8</left>
                         <top>140</top>
                         <width>150</width>
                         <height>200</height>
                         <info>ListItem.Icon</info>
                    </control>
               </itemlayout>
               <focusedlayout height="340" width="260">
                    <control type="image">
                         <left>1</left>
                         <top>0</top>
                         <width>258</width>
                         <height>340</height>
                         <info>ListItem.Icon</info>
                         <animation effect="zoom" delay="250" start="102,140,150,200" time="200">focus</animation>
                         <animation effect="zoom" delay="250" end="8,140,150,200" time="200">unfocus</animation>
                    </control>
               </focusedlayout>
          </control>

Viewing all articles
Browse latest Browse all 1803

Trending Articles