Sie sind nicht angemeldet.

1

Dienstag, 15. November 2016, 12:43

set hotspot‘s list outside scene

hi guys i set 2 language ui for the tour,and also set 2 language hospot for it.
i use combobox for selecting.it works when language change, but when the scene change the hospot still unchange.
here is the code
these 2 hospot is for the 2 language i set one visible "true" and one "false"

Quellcode

1
2
<hotspot name="spot7" style="floorchinese"  html="上楼" ath="-61.861" atv="8.823" onclick="switch(layer[skin1].visible);switch(layer[skin2].visible);" visible="true"/>
<hotspot name="spot10" style="floorenglish"  html="upstairs" ath="-61.861" atv="8.823" onclick="switch(layer[skin1].visible);switch(layer[skin2].visible);" visible="false"/>

i use this action change UI

Quellcode

1
2
3
4
5
6
<action name="change_skin_design">
		set(design, %1);
		copy(skin_thumbs_last_state, layer[skin_thumbs].state);
		loadpanoscene('%SWFPATH%/tour.xml', get(xml.scene), null, IGNOREKEEP|KEEPVIEW|KEEPMOVING, BLEND(0.5));
		
	</action>

this action change hotspot visible or not

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<action name="hotspotchinese">
for(set(i,0),i LT hotspot.count,inc(i),  
 if(hotspot[get(i)].style == 'floorenglish',
 set(hotspot[get(i)].visible,false);
 );
  if(hotspot[get(i)].style == 'floorchinese',
 set(hotspot[get(i)].visible,true);
 ); 
 );
 </action>
 <action name="hotspotenglish">
 for(set(i,0),i LT hotspot.count,inc(i), 
 if(hotspot[get(i)].style == 'floorchinese',
 set(hotspot[get(i)].visible,false);
 ); 
 if(hotspot[get(i)].style == 'floorenglish',
 set(hotspot[get(i)].visible,true);
 );
 );
 </action>

this is for the combobox

Quellcode

1
2
3
4
5
6
<plugin name="language" keep="true"
	        url="%SWFPATH%/plugins/combobox.swf"
	        alturl="%SWFPATH%/plugins/combobox.js" native="false"
	        align="lefttop" x="10" y="0" >
       <item name="item1" caption="国语"  onclick="change_skin_design('chinese');hotspotchinese();" />
    <item name="item2" caption="English"  onclick="change_skin_design('english');hotspotenglish();" />

could some one help me

2

Dienstag, 15. November 2016, 12:44

so i want if i can set one list of hotspot ouside scene, so i can change the include url for different language.

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

3

Dienstag, 15. November 2016, 13:25

Hi
About first...

You can use onloaded method to check what language is active in you project.

Quellcode

1
2
<hotspot name="spot7" style="floorchinese"  html="上楼" ... onloaded="if(design == 'english', set(visible, false))" />
<hotspot name="spot10" style="floorenglish"  html="upstairs" ...  onloaded="if(design == 'chinese', set(visible, false))" />



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

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

cms4vr team *thumbsup*

4

Mittwoch, 16. November 2016, 02:52

thanks a lot
it works