Triggering animation when setting <Visible> tag
#1
I've been working on some skins for PseudoTV and have run into a bit of trouble. I want to trigger a fade animation when the user presses the info button. The developer has coded it so that when the button is pressed, the addon sets the <visible> tag of a group control to true, thus showing the info window. Now this is where I want that window to fade in. I have tried adding the following code under the impression that when the group control is visible, the animation would be triggered.

Code:
<animation effect="fade" time="400">VisibleChange</animation>

I have also tried setting a slide animation for text that is triggered by the visibility of the group control to true.

Code:
<animation effect="slide" start="-120,0" time="200" condition="Control.HasFocus(2)">Conditional</animation>

Unfortunately none of these worked. My question is, is this the normal behavior or am I doing something wrong? If it's former, can this sort of thing (triggering animations from a python call) be added?
Reply
#2
There's two ways of hiding a control as far as guilib goes:

1. Call SetVisible() directly on the CGUIControl object.
2. Send a GUI_MSG_VISIBLE message to the CGUIControl object.

The first does not trigger animations, and is used more as a "force this visible or hidden NOW" - usually it's to absolutely ensure that something is never shown, i.e. to override any <visible> tags in the skin.

The second does trigger animations (and side note, is what the skin visibility stuff invokes).

So, to do it from python, one would switch the API from calling SetVisible to passing the message to the control. It may be reasonable to have a boolean to specify which one to use. A patch would be certainly be considered.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Interesting and thanks for explaining the differences between the two calls. I'll definitely look into it further and try to work up a patch.
Reply

Logout Mark Read Team Forum Stats Members Help
Triggering animation when setting <Visible> tag0