You are not logged in.

1

Tuesday, November 15th 2016, 12:43pm

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"

Source code

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

Source code

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

Source code

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

Source code

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

Tuesday, November 15th 2016, 12:44pm

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

spacerywirtualne

Professional

Posts: 1,117

Location: Poland, Europe

Occupation: krpano developer : virtual tours : the cms4vr owner

  • Send private message

3

Tuesday, November 15th 2016, 1:25pm

Hi
About first...

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

Source code

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

Wednesday, November 16th 2016, 2:52am

thanks a lot
it works