Sie sind nicht angemeldet.

1

Mittwoch, 29. September 2021, 18:05

tween action for "x.desktop" device-specific variable

Hi all,

is it possible to change a device-specific variable somehow in a tween action?

This does not work:

Quellcode

1
tween(layer[one].'x.handheld', 30, 1.0);


Curious if there is a way like above instead of using the expressions like below.

Quellcode

1
2
3
4
5
if(device.desktop,
tween(layer[one].x, 0, 1.0);
,
tween(layer[one].x, 30, 1.0);
);


Thanks in advance!
Max

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »loki« (29. September 2021, 18:42)


Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

2

Mittwoch, 29. September 2021, 18:57

Hi Max

you can go this way...


Quellcode

1
tween(layer[one].x, calc(device.desktop ? 0 : 30), 1.0);



Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

3

Mittwoch, 29. September 2021, 19:27

to clarify :
the device specific variable gets resolved at the beginning, when the xml gets parsed.
after that there is only one variable x

piotrs suggestion in other words :

Quellcode

1
2
3
4
5
if(device.desktop,
   tween(layer[one].x, 0, 1.0);
,
   tween(layer[one].x, 30, 1.0);
);

4

Mittwoch, 29. September 2021, 20:03

Thanks for the interesting approach and clearing that up you two.