Kodi Community Forum

Full Version: Animating Labels
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm using a panel container and want to do some positioning for the focused item. My problem is that each item contains some text (in a label) and this has to be positioned too but I can't get it to work.

The code should look something like the following (I'm shifting the position of the items depending on where they appear on screen):

Code:
<focusedlayout width="164" height="328">
  <control type="image">
    <posx>40</posx>
    <posy>10</posy>
    <width>104</width>
    <height>268</height>
    <texture>halfdisc.png</texture>
    <aspectratio>stretch</aspectratio>

    <animation effect="slide" time="300" delay="500" start="20,184,104,268" end="130,184,104,268" condition="Container.Position(0)">focus</animation>
    <animation effect="slide" time="300" delay="500" start="0,184,104,268" end="110,184,104,268" condition="Container.Position(1) | Container.Position(2)">focus</animation>
  </control>

  <control type="label">
    <posx>0</posx>
    <posy>0</posy>
    <width>100</width>
    <height>10</height>
    <font>VideoCaptionFont</font>
    <label>TITLE</label>

    <animation effect="slide" time="300" delay="500" start="20,150" end="160,150" condition="Container.Position(0)">focus</animation>
    <animation effect="slide" time="300" delay="500" start="0,150" end="140,150" condition="Container.Position(1) | Container.Position(2)">focus</animation>
  </control>
</focusedlayout>

When I run this code the label appears at 0,0 and doesn't animate at all. I've had success animating with labels in the past but only as part of a group control (when the group is animated the label moves with the group).

My next attempt was then to put a group around the label and animate it, unfortunately when I put the label within a group it no longer appears. It seems that it is not possible to have group controls within the focusedlayout tag?

In summary my two questions are as follows:

  1. Is it possible to animate a label control on its own?
  2. Is it possible to use a group control within a focusedlayout element in a panel?

Thanks