You are not logged in.

loki

Trainee

  • "loki" started this thread

Posts: 72

Location: Berlin

  • Send private message

1

Wednesday, September 29th 2021, 6:05pm

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:

Source code

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


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

Source code

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

This post has been edited 1 times, last edit by "loki" (Sep 29th 2021, 6:42pm)


spacerywirtualne

Professional

Posts: 1,117

Location: Poland, Europe

Occupation: krpano developer : virtual tours : the cms4vr owner

  • Send private message

2

Wednesday, September 29th 2021, 6:57pm

Hi Max

you can go this way...


Source code

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

Wednesday, September 29th 2021, 7:27pm

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 :

Source code

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

loki

Trainee

  • "loki" started this thread

Posts: 72

Location: Berlin

  • Send private message

4

Wednesday, September 29th 2021, 8:03pm

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