Sie sind nicht angemeldet.

1

Montag, 16. November 2020, 16:34

hide/show hotspot groups

Hi! I want to share a code example of how to show/hide groups of hotspots.
example http://novosibpano.ru/VT/groupHS/

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<action name="hide_show" scope="local" args="gr" >
   for(set(i,0), i LT hotspot.count, inc(i),
         copy(hs, global.hotspot[get(i)]);
         txtreplace(dstvar, gr, get(hs.group),);
         if(hs.group,
             if(dstvar !== gr,
                     set(hs.enabled, true);
                     set(hs.visible, true);
                     ,
                     set(hs.enabled, false);
                     set(hs.visible, false);
                );
             );
          );
</action>

Add the attribute to hotspots: group="red"
red is the name of the group
To show the group call the action : hide_show('red');
Hide hotspots that belong to other groups, if only they have a group.
To show multiple groups, simply list them in parentheses separated by commas: hide_show('green, red');


Only for local hotspots

2

Mittwoch, 18. November 2020, 01:27

This is very useful code. san7 *smile*

3

Sonntag, 6. Juni 2021, 13:42

Would it be possible to create an action to drag a group of 2 hotsposts that are in the same position to a new position?

thanks
Best

4

Sonntag, 6. Juni 2021, 18:27

I think when dragging and dropping, you will need to poll all hotspots for the presence of a group and, under this condition, transmit the coordinates of the dragged hotspot.
If you immediately register the name of the second hotspot inside the dragged hotspot, then it's easier to do

5

Sonntag, 6. Juni 2021, 19:41

Thanks for your help

https://dearte.online/group/

https://dearte.online/group/project3d.xml


this is what I am trying, before I used a layer parent hotspot, but in 3d it does not work

Best

6

Sonntag, 6. Juni 2021, 20:08

Try adding HSshadow = "sombra0" to the hotspot
In action name = "dragspot"

asyncloop (...
copy (hotspot [get (HSshadow)]. x, x);
copy (hotspot [get (HSshadow)]. y, y);
copy (hotspot [get (HSshadow)]. z, z);

7

Sonntag, 6. Juni 2021, 20:12

Ok Thanks


I will try it

8

Sonntag, 6. Juni 2021, 20:30

<hotspot name="sombra0" type="text" HSshadow = "sombra0".....



asyncloop(caller.pressed, .....



copy (hotspot [get (HSshadow)]. x, x);
copy (hotspot [get (HSshadow)]. y, y);
copy (hotspot [get (HSshadow)]. z, z);
callwith(caller, showspotinfos(); );


);
</action>

if I have put it correctly, it does not work

9

Sonntag, 6. Juni 2021, 20:55

Replace with this


asyncloop(caller.pressed, .....



copy(hotspot[get(caller.HSshadow)].tx, caller.tx);
copy(hotspot[get(caller.HSshadow)].ty, caller.ty);
copy(hotspot[get(caller.HSshadow)].tz, caller.tz);


callwith(caller, showspotinfos(); );


);
</action>

10

Sonntag, 6. Juni 2021, 21:09

it does not work *wacko*

11

Sonntag, 6. Juni 2021, 21:11

and with groups?

12

Montag, 7. Juni 2021, 04:26

it does not work *wacko*
I checked, this is working code *smile*
example

13

Montag, 7. Juni 2021, 10:30

Ok, perfect!!
Thanks
Best ;-)

14

Donnerstag, 10. Juni 2021, 01:01

How can I activate and deactivate an action?
for example in this case "dragspot"

thank you and good night

15

Donnerstag, 10. Juni 2021, 09:27

How can I activate and deactivate an action?
for example in this case "dragspot"

thank you and good night
Create a variable like "drag" and toggle its value (false / true).
Take action on the condition of this variable, for example:

Quellcode

1
2
3
4
5
<action name="dragspot"> 
     if(drag,	
        ... the code ...	
       );	
 </action>

16

Donnerstag, 10. Juni 2021, 14:40

Ok, thanks.
I will try it ;-)

17

Donnerstag, 10. Juni 2021, 21:04




now the hotspots only move along the wall and the shadow remains at the original distance.
I need to find an action to scale, and toggle each of them on and off.

Something curious is that if you do not touch the viewer for some time then the hotspots begin to flash *cry*


dearte.online/h2/

18

Donnerstag, 16. Juni 2022, 09:58

A bit late to this post but thanks very much *thumbsup*

Ähnliche Themen