Kodi Community Forum

Full Version: getX of object's animation location
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It might even be possible already, with me having just not realized it... having not seen any documented syntax for it. If not, hopefully it could be considered as a featured request for 15.x.

What I'm doing is trying to catch the .getX() of an object (type="image") that is being eternally moved by an animation (type="slide"). The problem I'm having is .getX() gets the location of where the object was last set to via .setPosition(x,y) or <posx> or <left>, but there doesn't seem to be a documented variable or function to retreive the location of where it's being displayed on the screen via the animation... which is what I'm needing for a project. I dont mind rather its the displayed location screen-wise resolution (sometimes larger like with or skin-wise resolution (1280x720). Even if someone knows a way to calculate the displayed position via the x,y set location, animation start & end locaitons, time & delay values, and current & initial timestamps maybe?!

I'm trying to do is basically make smoother object flow, and still be able to code for object interactions when 2 meet or is in line-of-fire... basically allowing for easier making of fun little playful games and such with less movement-studder and need for troublesome while-statements and other loops which can be harder on the system when it comes time to close the game / addon.

Code:
<animation start="-101,50" end="1281,50" time="12000" delay="0" effect="slide" loop="true" reversible="true" pulse="true" condition="true">conditional</animation>

Code:
print (['screen size',self.getWidth(),self.getHeight()])
--- --- ---

Also, I've noticed that I can't seem to get
Code:
<constant name="MaxWidth">1280</constant>
or any kind of
Code:
<include ...>...</include>
to work in a custom skin / WindowXML ran by .doModal(). Am i just not understanding how to do it or where to place it (maybe needing <includes></includes> around it), or does it just not work via addons use?
(2015-02-21, 20:53)HIGHWAY99 Wrote: [ -> ]Also, I've noticed that I can't seem to get
Code:
<constant name="MaxWidth">1280</constant>
or any kind of
Code:
<include ...>...</include>
to work in a custom skin / WindowXML ran by .doModal(). Am i just not understanding how to do it or where to place it (maybe needing <includes></includes> around it), or does it just not work via addons use?

correct, some stuff (includes, constants, variables) only works if the skin itself provides the xml for the addon.
I've also noticed that while
Code:
self.setProperty('ScreenType','')
and
Code:
self.setProperty('ScreenType','game')
seem to work with
Code:
<visible>StringCompare(Container.Property(ScreenType),game)</visible>
, that self.getProperty('ScreenType') seems to not work. It seems to only give back a blank string reguardless of what's set as the property currently.

Code:
self.ScreenType=self.getProperty('ScreenType')
print (['ScreenTypeB',self.ScreenType])