Hi,
I wonder what will be the syntax of getting values of variables like the above mentioned.
Eg "trace(get(plugin[blabla].width.mobile));" will not work. How can I get these extended variables like x.mobile, y.tablet etc.?
Thanks!
Hi,
I wonder what will be the syntax of getting values of variables like the above mentioned.
Eg "trace(get(plugin[blabla].width.mobile));" will not work. How can I get these extended variables like x.mobile, y.tablet etc.?
Thanks!
plugin[blabla].width="50" plugin[blabla].width.mobile="100"
means width will be normally 50, or 100 if device.mobile is true
after the xml is parsed you cant get to these device specific values anymore,
but you have the result in plugin[blabla].width
trace(plugin[blabla].width);
ah, so with get(plugin[blabla].width) I will get mobile-width when using a mobile device and desktop-width when using desktop...
Thanks!
yes normally you set a default and the specials
...
with="200" with.mobile="250"
...
Hi,
everything after the '.' dot in an attribute name is a kind of 'filter' for the xml parsing.
It decides if that attribute will be parsed and set or skipped.
Please see here for more:
https://krpano.com/docu/xml/#devicechecksforattributes
One additional note about:
plugin[blabla].width="50" plugin[blabla].width.mobile="100"
means width will be normally 50, or 100 if device.mobile is true
Attributes are parsed one after the other - and some browsers (only IE so far I known) are passing the arguments in RANDOM order to the application (=to krpano). According to the xml-specs this is allowed.
So it's not guaranteed that width.mobile="..." will be processed after width="...".
Therefore 'non-overlapping' declration should be used.
E.g. correct would be:
width.normal="..."
width.mobile="..."
The filter '.normal' will cover desktop and tablet devices and '.mobile' will cover mobile devices. So all cases are clear and the order doesn't matter.
Best regards,
Klaus
Don’t have an account yet? Register yourself now and be a part of our community!