Show/hide hotspots group by type  

Share your tips and tricks here or get help with any Panotour 2.0 problem!
No bug reports (of any kind) in this forum!
User avatar
AH360
Member
 
Posts: 19
Joined: Mon Jun 25, 2012 11:17 am
Location: Brazil | Londrina

Show/hide hotspots group by type

by AH360 » Tue Aug 05, 2014 9:51 pm

I have a tour with several types of hotspots, for example, A and B type

I wish I could create a button, not one that is in control bar, a side button, in order to show/hide only the hotspot group that I want.

I think programming in XML code is the way to go, but I'm no an expert in XML code. Could anyone help me how to modify the XML code to do that?

Regards,

Akio

User avatar
benji33
Kolor Team
 
Posts: 2768
Joined: Tue Apr 09, 2013 10:59 am
Location: France

Re: Show/hide hotspots group by type

by benji33 » Wed Aug 06, 2014 10:34 am

If type A and B are differents styles into the Style view you can do something like that. This demo is done only for one single scene some other things must be done to transit the button state on different scenes.

- Open the file YourTourdata/YourTour_skin.xml

- Look after the styles names of each kind of spot into xml (in the beginning part of the file).
For instance <style name="IconDefaultPointSpotStyle1" ... />

- Add a toggle button with Interface > Hide Hotspots and Interface > Show Hotspots actions

- Edit YourTourdata/YourTour_skin.xml to change the code of the new button added :

Edit change this kind of code
Code: Select all
<action name="togglebuttonOnClick">
    if (state,
      set(state, false);hideHotspots();
      set(url,%FIRSTXML%/graphics/togglebutton/image1.jpg);
     ,
      set(state, true);showHotspots();
      set(url,%FIRSTXML%/graphics/togglebutton/image2.jpg);
    );
  </action>


Into this
Code: Select all
  <action name="togglebuttonOnClick">
    if (state,
      set(state, false);
      for(set(i,0), i LT hotspot.count, inc(i),
        if(hotspot[get(i)].style == 'IconDefaultPointSpotStyle1',
          set(hotspot[get(i)].visible, false);
        );
      );
      set(url,%FIRSTXML%/graphics/togglebutton/image1.jpg);
     ,
      set(state, true);
      for(set(i,0), i LT hotspot.count, inc(i),
        if(hotspot[get(i)].style == 'IconDefaultPointSpotStyle1',
          set(hotspot[get(i)].visible, true);
        );
      );   
      set(url,%FIRSTXML%/graphics/togglebutton/image2.jpg);
    );
  </action>


Do the same for others spots styles.

It's the idea.

User avatar
AH360
Member
 
Posts: 19
Joined: Mon Jun 25, 2012 11:17 am
Location: Brazil | Londrina

Re: Show/hide hotspots group by type

by AH360 » Wed Aug 06, 2014 1:42 pm

Thanks Benjamin, I really appreciate your help.

Yesterday, I was trying to find by myself and I actually found were to change, but a very very hard way. Had to change the main.xml, main_skin.xml and main_core.xml, as you can see, the way you show me, is easier than mine, and faster.

Thanks


Return to Using Panotour / Panotour Pro

Who is online

Users browsing this forum: No registered users and 1 guest