|
@@ -0,0 +1,539 @@
|
|
|
+<krpano>
|
|
|
+ <!-- 1.20. 新热点模式 -->
|
|
|
+ <action name="addJQHotspot">
|
|
|
+ showlog();
|
|
|
+ set(hsp_name,%1);
|
|
|
+ set(hsp_type,%2);
|
|
|
+ txtadd(iconUrl,'',%4);
|
|
|
+ txtreplace(iconUrl,'|',',');
|
|
|
+ <!-- trace('originName::',%1); -->
|
|
|
+ if(%2 LE 1,
|
|
|
+ <!-- trace('id==',get(hsp_name),"::",get(iconUrl)); -->
|
|
|
+ set(hotspot[get(hsp_name)].type,'image');
|
|
|
+ set(hotspot[get(hsp_name)].url,get(iconUrl));
|
|
|
+ );
|
|
|
+ ifnot(%2 LE 1, set(hotspot[get(hsp_name)].type, 'text'));
|
|
|
+
|
|
|
+ <!-- 其他标签 (0,1,2)-->
|
|
|
+
|
|
|
+ set(hotspot[get(hsp_name)].name,%1);
|
|
|
+ set(hotspot[get(hsp_name)].hotspottype,%2);
|
|
|
+ set(hotspot[get(hsp_name)].hotspottitle,%3);
|
|
|
+ set(hotspot[get(hsp_name)].hotspotStyle,%10);
|
|
|
+ set(hotspot[get(hsp_name)].hotlink,%7);
|
|
|
+ set(hotspot[get(hsp_name)].ath,%5);
|
|
|
+ set(hotspot[get(hsp_name)].atv,%6);
|
|
|
+ set(hotspot[get(hsp_name)].visible,true);
|
|
|
+ set(hotspot[get(hsp_name)].alpha,1);
|
|
|
+ set(hotspot[get(hsp_name)].scale,1);
|
|
|
+ set(hotspot[get(hsp_name)].autoalpha,false);
|
|
|
+ set(hotspot[get(hsp_name)].distorted,false);
|
|
|
+ set(hotspot[get(hsp_name)].border,false);
|
|
|
+ set(hotspot[get(hsp_name)].onclick,'js(__krfn.utils.linkopen(%7,%1));');
|
|
|
+ set(hotspot[get(hsp_name)].ondown,dragJQhotspot(););
|
|
|
+ set(hotspot[get(hsp_name)].onup,js(console.log('0');__krfn.angle.updateHotSpotData(get(xml.scene),get(name),get(ath),get(atv))));
|
|
|
+
|
|
|
+ txtsplit(%10,'|',fontSize,pos,isHover,borderColor,fillColor,textColor,isShowLine,isTextWrap,lineDirection,textDirection,textNumPerLine,duration,frameNumber,framewidth);
|
|
|
+ set(hotspot[get(hsp_name)].pos,pos);
|
|
|
+ txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();add_tooltip_dot();");
|
|
|
+
|
|
|
+ if(%2 LE 2,
|
|
|
+ set(hotspot[get(hsp_name)].height,%8);
|
|
|
+ set(hotspot[get(hsp_name)].width,%8);
|
|
|
+ set(hotspot[get(hsp_name)].crop,'');
|
|
|
+ <!-- txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label(get(%1));"); -->
|
|
|
+ if(%2 == 2,
|
|
|
+ trace('ser_frame::',get(framewidth));
|
|
|
+ set(hotspot[get(hsp_name)].url,get(iconUrl));
|
|
|
+ set(hotspot[get(hsp_name)].framewidth,get(framewidth));
|
|
|
+ set(hotspot[get(hsp_name)].frames,get(frameNumber));
|
|
|
+
|
|
|
+ crop_animation_r_stop(get(hsp_name));
|
|
|
+
|
|
|
+ txtadd(hotspot[get(hsp_name)].onloaded,"trace('onloaded::',get(frameNumber),get(framewidth));do_crop_animation(get(framewidth),get(framewidth),get(frameNumber));"););
|
|
|
+ );
|
|
|
+
|
|
|
+ <!-- 个性化标签(3) -->
|
|
|
+ if(%2 == 3,
|
|
|
+ set(hotspot[get(hsp_name)].height,80);
|
|
|
+ set(hotspot[get(hsp_name)].width,1);
|
|
|
+ set(hotspot[get(hsp_name)].padding,0);
|
|
|
+ set(hotspot[get(hsp_name)].background,false);
|
|
|
+ txtadd(line,'<div style="background-color: ',get(borderColor),';width:1px;height:80px;"></div>');
|
|
|
+ copy(hotspot[get(hsp_name)].html,line);
|
|
|
+ <!-- txtadd(hotspot[get(hsp_name)].onloaded,"add_tooltip_label();add_tooltip_dot();"); -->
|
|
|
+ set_label_dir(get(hsp_name),get(lineDirection),0);
|
|
|
+
|
|
|
+ );
|
|
|
+
|
|
|
+ addhotspot(get(hsp_name));
|
|
|
+ </action>
|
|
|
+
|
|
|
+ <action name="do_crop_animation">
|
|
|
+ registerattribute(xframes, calc((imagewidth / %1) BOR 0));
|
|
|
+ registerattribute(yframes, calc((imageheight / %2) BOR 0));
|
|
|
+ registerattribute(frames, calc(xframes * yframes));
|
|
|
+ registerattribute(frame, 0);
|
|
|
+ registerattribute(animatiedOn, 1);
|
|
|
+ registerattribute(frameRate, calc(1.0 / %3));
|
|
|
+ set(crop, '0|0|%1|%2');
|
|
|
+ clearinterval(calc('crop_anim_' + name));
|
|
|
+ if(frameRate GE 0,
|
|
|
+ setinterval(
|
|
|
+ calc('crop_anim_' + name),
|
|
|
+ get(frameRate),
|
|
|
+ if(loaded,
|
|
|
+ inc(frame);
|
|
|
+ if(frame GE frames, if(onlastframe !== null, onlastframe() ); set(frame,0); );
|
|
|
+ mod(xpos,frame, xframes);
|
|
|
+ div(ypos, frame, xframes);
|
|
|
+ <!-- trace('onging::',get(frames)); -->
|
|
|
+ Math.floor(ypos);
|
|
|
+ mul(xpos, %1);
|
|
|
+ mul(ypos, %2);
|
|
|
+ calc(crop, xpos +'|' + ypos + '|%1|%2');
|
|
|
+
|
|
|
+ if(animatiedOn == 0,
|
|
|
+ clearinterval(calc('crop_anim_' + name));
|
|
|
+ );
|
|
|
+,
|
|
|
+ clearinterval(calc('crop_anim_' + name));
|
|
|
+ );
|
|
|
+ );
|
|
|
+ );
|
|
|
+ </action>
|
|
|
+ <action name="crop_animation_r_stop">
|
|
|
+ set(cur,%1);
|
|
|
+ tolower(cur, cur);
|
|
|
+ set(curIn, calc('crop_anim_r_' + cur));
|
|
|
+ clearinterval(curIn);
|
|
|
+ </action>
|
|
|
+
|
|
|
+ <action name="crop_animation_reapply">
|
|
|
+ txtadd(cur,'',%1);
|
|
|
+ tolower(cur, cur);
|
|
|
+ txtadd(frameRate,'',%2);
|
|
|
+ txtadd(framewidth,'',%3);
|
|
|
+ txtadd(frameNumber,'',%4);
|
|
|
+ copy(frames, hotspot[get(cur)].frames);
|
|
|
+ copy(xframes, hotspot[get(cur)].xframes);
|
|
|
+ copy(yframes, hotspot[get(cur)].yframes);
|
|
|
+ copy(animatiedOn, hotspot[get(cur)].animatiedOn);
|
|
|
+ set(frame,0);
|
|
|
+ set(curIn, calc('crop_anim_r_' + cur));
|
|
|
+
|
|
|
+ clearinterval(curIn);
|
|
|
+ if(get(frameRate) GE 0,
|
|
|
+ setinterval(curIn,
|
|
|
+ get(frameRate),
|
|
|
+ inc(frame);
|
|
|
+ copy(on, hotspot[get(cur)].on);
|
|
|
+
|
|
|
+ if(frame GE frames, set(frame,0); );
|
|
|
+ mod(xpos,frame, xframes);
|
|
|
+ div(ypos, frame, xframes);
|
|
|
+ Math.floor(ypos);
|
|
|
+ mul(xpos, framewidth);
|
|
|
+ mul(ypos,framewidth);
|
|
|
+ trace('frame-1::',get(animatiedOn));
|
|
|
+ calc(crop, xpos +'|' + ypos + '|'+framewidth +'|' + framewidth);
|
|
|
+ if(frames == -1,
|
|
|
+ copy(hotspot[get(hsp_name)].crop,'0|0|204|204');
|
|
|
+ );
|
|
|
+ <!-- trace('replaying::',get(frame)); -->
|
|
|
+ copy(hotspot[get(hsp_name)].crop,crop);
|
|
|
+ );
|
|
|
+ );
|
|
|
+
|
|
|
+ </action>
|
|
|
+
|
|
|
+ <action name="add_tooltip_label">
|
|
|
+ txtadd(tooltipname, 'tooltip_', get(name));
|
|
|
+ txtsplit(hotspotStyle,'|',fontSize,pos,isHover,borderColor,fillColor,textColor,isShowLine,isTextWrap,lineDirection,textDirection,textNumPerLine,duration,frameNumber);
|
|
|
+ txtadd(pName, get(name));
|
|
|
+ addlayer(get(tooltipname));
|
|
|
+ txtadd(layer[get(tooltipname)].parent, 'hotspot[', get(name), ']');
|
|
|
+ set(layer[get(tooltipname)].autowidth, true);
|
|
|
+ set(layer[get(tooltipname)].width,'prop');
|
|
|
+ <!-- set(layer[get(tooltipname)].height,30); -->
|
|
|
+ set(layer[get(tooltipname)].height,30);
|
|
|
+ set(layer[get(tooltipname)].edge,center);
|
|
|
+ set(layer[get(tooltipname)].background,false);
|
|
|
+ set(layer[get(tooltipname)].pos,pos);
|
|
|
+ set(layer[get(tooltipname)].padding,0);
|
|
|
+ set(layer[get(tooltipname)].type,'html');
|
|
|
+ set(layer[get(tooltipname)].url,'%SWFPATH%/plugins/textfield.swf');
|
|
|
+ set(layer[get(tooltipname)].border,false);
|
|
|
+ set(layer[get(tooltipname)].align,center);
|
|
|
+ copy(layer[get(tooltipname)].hotlink, hotspot[get(name)].hotlink);
|
|
|
+ set(layer[get(tooltipname)].ondown,'dragJQlayer();');
|
|
|
+
|
|
|
+ set(layer[get(tooltipname)].onclick,JQlayerClick);
|
|
|
+ set(layer[get(tooltipname)].onup,js(console.log('1');__krfn.angle.updateHotSpotData(get(xml.scene),get(hsName),get(ath),get(atv))));
|
|
|
+ <!-- set(hotspot[get(hsp_name)].onup,js(__krfn.angle.updateHotSpotData(get(xml.scene),get(name),get(ath),get(atv)))); -->
|
|
|
+ txtadd(labelCode, '<div style="display: flex; align-items: center; justify-content: center; position: relative; border: 1px solid ',get(borderColor),'; padding: 6px 10px; white-space: pre; border-radius: 5px; background: ',get(fillColor),'">',' <div style="text-align: left; font-size:',get(fontSize),'px; color: ',get(textColor),'; line-height: 1.4;">',get(hotspottitle),'</div>
|
|
|
+ </div>');
|
|
|
+
|
|
|
+ <!-- label方位 -->
|
|
|
+ if(get(hotspottype) LE 2,
|
|
|
+ <!-- trace('hotspottype::',get(hotspottype),'::tooltipname::',get(tooltipname),'pos::',get(pos)); -->
|
|
|
+ <!-- set_label_pos(get(tooltipname),get(pos)); -->
|
|
|
+ delayedcall(0.1,
|
|
|
+ txtadd(tooltipname, 'tooltip_', get(name));
|
|
|
+ set_label_pos(get(tooltipname),get(pos));
|
|
|
+ );
|
|
|
+ );
|
|
|
+
|
|
|
+ <!-- 个性化标签(3) -->
|
|
|
+ if(get(hotspottype) == 3,
|
|
|
+ set(layer[get(tooltipname)].direction,get(lineDirection));
|
|
|
+ delayedcall(0.2,txtadd(tooltipname, 'tooltip_', get(name)); set_label_dir(get(tooltipname),get(layer[get(tooltipname)].direction),1); );
|
|
|
+
|
|
|
+
|
|
|
+ );
|
|
|
+ copy(layer[get(tooltipname)].html, labelCode);
|
|
|
+
|
|
|
+ </action>
|
|
|
+ <!-- <style name="tooltip_dot_bg" type="container" border-radius="50%" bgcolor="0xFFFFFF" bgalpha="0.9" height="20" width="20" keep="true" /> -->
|
|
|
+ <action name='add_tooltip_dot'>
|
|
|
+ txtadd(tooldot, 'tooldot_', get(name));
|
|
|
+ <!-- trace('hey::',get(borderColor)); -->
|
|
|
+ addlayer(get(tooldot));
|
|
|
+ txtadd(layer[get(tooldot)].parent, 'hotspot[', get(name), ']');
|
|
|
+ set(layer[get(tooldot)].width,10);
|
|
|
+ set(layer[get(tooldot)].height,10);
|
|
|
+ set(layer[get(tooldot)].padding,0);
|
|
|
+
|
|
|
+ set(layer[get(tooldot)].align,center);
|
|
|
+ set(layer[get(tooldot)].type,'text');
|
|
|
+ set(layer[get(tooldot)].background,false);
|
|
|
+ txtadd(dborderColor,'rgba(255,255,255,0.5)');
|
|
|
+ txtadd(dot,'<div style="background-color: ',get(borderColor),';width:10px;height:10px;"></div>');
|
|
|
+ copy(layer[get(tooldot)].html,dot);
|
|
|
+ set(layer[get(tooldot)].backgroundcolor,get(borderColor));
|
|
|
+ set(layer[get(tooldot)].backgroundalpha,0.9);
|
|
|
+ set(layer[get(tooldot)].bgroundedge,5);
|
|
|
+ set(layer[get(tooldot)].onclick,JQlayerClick);
|
|
|
+ set(layer[get(tooldot)].ondown,'dragJQlayer();');
|
|
|
+ set(layer[get(tooldot)].visible,false);
|
|
|
+ set(layer[get(tooldot)].onup,js(console.log('2');__krfn.angle.updateHotSpotData(get(xml.scene),get(hsName),get(ath),get(atv))));
|
|
|
+
|
|
|
+ <!-- 个性化标签(3) -->
|
|
|
+ if(get(hotspottype) == 3,
|
|
|
+ <!-- trace('lineDirection3::',lineDirection); -->
|
|
|
+ <!-- call(set_label_dir); -->
|
|
|
+ set(layer[get(tooldot)].visible,true);
|
|
|
+ set_label_dir(get(tooldot),get(lineDirection),2);
|
|
|
+ );
|
|
|
+
|
|
|
+ </action>
|
|
|
+ <action name='set_label_dir'>
|
|
|
+ txtadd(dirItem,'',%1);
|
|
|
+ txtadd(lineDirection,'',%2);
|
|
|
+ txtadd(dir,'',%3);
|
|
|
+ <!-- trace('get-lineDirection::',%2); -->
|
|
|
+ <!-- trace('set_label_dir::1::',get(dirItem),'::2::',get(lineDirection),'::3::',get(dir)); -->
|
|
|
+ if(
|
|
|
+ get(dir)==1,
|
|
|
+ <!-- trace('set_label_dir::1::',get(dirItem),'::2::',get(lineDirection),'::3::',get(dir)); -->
|
|
|
+ copy(labelWidth,layer[get(dirItem)].width);
|
|
|
+ <!-- trace('dirItem::',get(layer[get(dirItem)].width)); -->
|
|
|
+ );
|
|
|
+
|
|
|
+ if(
|
|
|
+ get(lineDirection) == 'right-top',
|
|
|
+ if(get(dir)==0,set(hotspot[get(dirItem)].rotate,35));
|
|
|
+ if(get(dir)==1,set(layer[get(dirItem)].rotate,-35);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-60););
|
|
|
+ if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,40););
|
|
|
+ );
|
|
|
+ if(
|
|
|
+ get(lineDirection) == 'right-center',
|
|
|
+ if(get(dir)==0,set(hotspot[get(dirItem)].rotate,90););
|
|
|
+ <!-- if(get(dir)==1,set(layer[get(dirItem)].rotate,-90);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-80)); -->
|
|
|
+ if(get(dir)==1,
|
|
|
+ trace('labelWidth::',labelWidth);
|
|
|
+ set(layer[get(dirItem)].rotate,-90);
|
|
|
+ set(layer[get(dirItem)].x,0);
|
|
|
+ sub(labelWidth,25);
|
|
|
+ mul(labelWidth,-1);
|
|
|
+ set(layer[get(dirItem)].y,get(labelWidth));
|
|
|
+ );
|
|
|
+
|
|
|
+ if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,40););
|
|
|
+ );
|
|
|
+ if(
|
|
|
+ get(lineDirection) == 'right-bottom',
|
|
|
+ if(get(dir)==0,set(hotspot[get(dirItem)].rotate,-35));
|
|
|
+ if(get(dir)==1,set(layer[get(dirItem)].rotate,35);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,60));
|
|
|
+ if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-40););
|
|
|
+ );
|
|
|
+ if(
|
|
|
+ get(lineDirection) == 'center-top',
|
|
|
+ if(get(dir)==0,set(hotspot[get(dirItem)].rotate,0));
|
|
|
+ if(get(dir)==1,set(layer[get(dirItem)].rotate,0);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-60));
|
|
|
+ if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,40););
|
|
|
+ );
|
|
|
+ if(get(lineDirection) == 'center-bottom',
|
|
|
+ if(get(dir)==0,set(hotspot[get(dirItem)].rotate,0));
|
|
|
+ if(get(dir)==1,set(layer[get(dirItem)].rotate,0);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,55));
|
|
|
+ if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-40););
|
|
|
+ );
|
|
|
+ if( get(lineDirection) == 'left-top',
|
|
|
+ if(get(dir)==0,set(hotspot[get(dirItem)].rotate,-35));
|
|
|
+ ; if(get(dir)==1,set(layer[get(dirItem)].rotate,35);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-60));
|
|
|
+ if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,40););
|
|
|
+ );
|
|
|
+ if(
|
|
|
+ get(lineDirection) == 'left-center',
|
|
|
+ if(get(dir)==0,set(hotspot[get(dirItem)].rotate,90));
|
|
|
+
|
|
|
+ if(get(dir)==1,
|
|
|
+ set(layer[get(dirItem)].rotate,-90);
|
|
|
+ set(layer[get(dirItem)].x,0);
|
|
|
+ sub(labelWidth,25);
|
|
|
+ set(layer[get(dirItem)].y,get(labelWidth));
|
|
|
+ );
|
|
|
+ if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-40););
|
|
|
+ );
|
|
|
+ if(
|
|
|
+ get(lineDirection) == 'left-bottom',
|
|
|
+ if(get(dir)==0,set(hotspot[get(dirItem)].rotate,35));
|
|
|
+ if(get(dir)==1,set(layer[get(dirItem)].rotate,-35);set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,60));
|
|
|
+ if(get(dir)==2,set(layer[get(dirItem)].x,0);set(layer[get(dirItem)].y,-40););
|
|
|
+
|
|
|
+ );
|
|
|
+
|
|
|
+ </action>
|
|
|
+
|
|
|
+ <action name='set_label_pos'>
|
|
|
+ <!-- label方位 -->
|
|
|
+ set(posName,%1);
|
|
|
+ set(pos,%2);
|
|
|
+ copy(hp,posName);
|
|
|
+ txtreplace(hp,'tooltip_','');
|
|
|
+
|
|
|
+ copy(hwidth, hotspot[get(hp)].width);
|
|
|
+ copy(hheight, hotspot[get(hp)].height);
|
|
|
+
|
|
|
+ copy(lwidth, layer[get(posName)].width);
|
|
|
+ copy(lheight, layer[get(posName)].height);
|
|
|
+
|
|
|
+ if(
|
|
|
+ pos == 'top',
|
|
|
+ add(all,lheight,hheight);
|
|
|
+ div(dpy,all,2);
|
|
|
+ add(lastPy,dpy,10);
|
|
|
+ mul(lastPy, -1);
|
|
|
+ set(layer[get(posName)].align,center);
|
|
|
+ set(layer[get(posName)].y,get(lastPy));
|
|
|
+ set(layer[get(posName)].x,0);
|
|
|
+ );
|
|
|
+ if(
|
|
|
+ pos == 'bottom',
|
|
|
+ add(all,lheight,hheight);
|
|
|
+ div(dpy,all,2);
|
|
|
+ add(lastPy,dpy,10);
|
|
|
+ mul(lastPy, 1);
|
|
|
+ set(layer[get(posName)].align,center);
|
|
|
+ set(layer[get(posName)].y,get(lastPy));
|
|
|
+ set(layer[get(posName)].x,0);
|
|
|
+ );
|
|
|
+ if(
|
|
|
+ pos == 'left',
|
|
|
+ add(all,lwidth,hwidth);
|
|
|
+ div(dpx,all,2);
|
|
|
+ add(lastPx,dpx,10);
|
|
|
+ mul(lastPx, -1);
|
|
|
+ set(layer[get(posName)].align,center);
|
|
|
+ set(layer[get(posName)].x,get(lastPx));
|
|
|
+ set(layer[get(posName)].y,0);
|
|
|
+ );
|
|
|
+ if(
|
|
|
+ pos == 'right',
|
|
|
+ add(all,lwidth,hwidth);
|
|
|
+ div(dpx,all,2);
|
|
|
+ add(lastPx,dpx,10);
|
|
|
+ mul(lastPx, 1);
|
|
|
+ set(layer[get(posName)].align,center);
|
|
|
+ set(layer[get(posName)].x,get(lastPx));
|
|
|
+ set(layer[get(posName)].y,0);
|
|
|
+ );
|
|
|
+ </action>
|
|
|
+
|
|
|
+
|
|
|
+ <action name="removeJQHotspot">
|
|
|
+ set(delHotspot,%1);
|
|
|
+ removehotspot(%1,true);
|
|
|
+ txtadd(delHotspotLabel,'tooltip_',get(delHotspot));
|
|
|
+ txtadd(delHotspotdot,'tooldot_',get(delHotspot));
|
|
|
+ removelayer(get(delHotspotLabel));
|
|
|
+ removelayer(get(delHotspotdot));
|
|
|
+ </action>
|
|
|
+
|
|
|
+ <action name="cancelJQHotspot">
|
|
|
+ set(canclHotspot,%1);
|
|
|
+ crop_animation_r_stop(%1);
|
|
|
+ </action>
|
|
|
+
|
|
|
+ <!-- 编辑热点 -->
|
|
|
+ <action name="editJQHotspot">
|
|
|
+ showlog();
|
|
|
+ set(hsp_name,%1);
|
|
|
+ set(hsp_type,%2);
|
|
|
+ set(dImage,'static/panoassets/images/hotspot/image_place_holder.png');
|
|
|
+ txtadd(hsLabel, 'tooltip_', %1);
|
|
|
+ txtadd(hsDot, 'tooldot_', %1);
|
|
|
+ set(hotspot[get(hsp_name)].hotspottitle,%3);
|
|
|
+ set(hotspot[get(hsp_name)].hotspotStyle,%10);
|
|
|
+ copy(hotspot[get(hsp_name)].borderWidth,false);
|
|
|
+ copy(layer[get(hsLabel)].borderWidth,false);
|
|
|
+ copy(layer[get(hsDot)].borderWidth,false);
|
|
|
+ set(hotspot[get(hsp_name)].background,false);
|
|
|
+ txtsplit(%10,'|',fontSize,pos,isHover,borderColor,fillColor,textColor,isShowLine,isTextWrap,lineDirection,textDirection,textNumPerLine,duration,frameNumber,framewidth);
|
|
|
+ txtadd(labelCode, '<div style="min-height:30px; display: flex; align-items: center; justify-content: center; position: relative; border: 1px solid ',get(borderColor) ,'; padding: 6px 10px; white-space: pre; border-radius: 5px; background: ',get(fillColor),'">',' <div style="text-align: left; font-size:',get(fontSize),'px; color: ',get(textColor),'; line-height: 1.4;">',%3,'</div>
|
|
|
+ </div>');
|
|
|
+ copy(layer[get(hsLabel)].html, labelCode);
|
|
|
+ copy(layer[get(hsLabel)].pos, pos);
|
|
|
+ trace('editJQHotspot',%1,'::type::',%3);
|
|
|
+
|
|
|
+ if(%3 == '',
|
|
|
+ trace('title-empty');
|
|
|
+ set(layer[get(hsLabel)].height,12));
|
|
|
+
|
|
|
+ <!-- if(%3 == '',
|
|
|
+ trace('title-empty');
|
|
|
+ set(layer[get(hsLabel)].height,12)
|
|
|
+ );
|
|
|
+ ifnot(%3 == '',trace('has-title'); set(layer[get(hsLabel)].height,30);); -->
|
|
|
+
|
|
|
+ if(get(hsp_type) == 3,
|
|
|
+
|
|
|
+ set(hotspot[get(hsp_name)].rotate,0);
|
|
|
+ set(layer[get(hsLabel)].rotate,0)
|
|
|
+ set(hotspot[get(hsp_name)].type,'text');
|
|
|
+ set(hotspot[get(hsp_name)].width,1);
|
|
|
+ set(hotspot[get(hsp_name)].height,80);
|
|
|
+ set(hotspot[get(hsp_name)].padding,0);
|
|
|
+
|
|
|
+
|
|
|
+ txtadd(line,'<div style="background-color: ',get(borderColor),';width:1px;height:80px;"></div>');
|
|
|
+ txtadd(dot,'<div style="background-color: ',get(borderColor),';width:10px;height:10px;"></div>');
|
|
|
+ copy(hotspot[get(hsp_name)].html,line);
|
|
|
+ copy(layer[get(hsDot)].html,dot);
|
|
|
+ set(layer[get(hsDot)].visible,true);
|
|
|
+
|
|
|
+ set_label_dir(get(hsp_name),get(lineDirection),0);
|
|
|
+ set_label_dir(get(hsLabel),get(lineDirection),1);
|
|
|
+ set_label_dir(get(hsDot),get(lineDirection),2);
|
|
|
+
|
|
|
+ );
|
|
|
+ if(get(hsp_type) LE 2,
|
|
|
+ trace('edit2::',get(hsp_name));
|
|
|
+ txtadd(iconUrl,'',%4);
|
|
|
+ txtreplace(iconUrl,'|',',');
|
|
|
+ trace('iconUrl::',iconUrl);
|
|
|
+ set(hotspot[get(hsp_name)].height,%8);
|
|
|
+ set(hotspot[get(hsp_name)].width,%8);
|
|
|
+
|
|
|
+ delayedcall(0.1,
|
|
|
+ txtadd(tooltipname, 'tooltip_', get(hsp_name));
|
|
|
+ set_label_pos(get(tooltipname),get(layer[get(tooltipname)].pos));
|
|
|
+ );
|
|
|
+ <!-- 序列化类型编辑 -->
|
|
|
+ if(get(hsp_type) == 2,
|
|
|
+ indexoftxt(index, get(iconUrl), 'image_place_holder.png');
|
|
|
+
|
|
|
+ if(get(index) GT -1,trace('place-holder');
|
|
|
+ set(hotspot[get(hsp_name)].animatiedOn,0);
|
|
|
+ set(hotspot[get(hsp_name)].crop,'');
|
|
|
+ crop_animation_r_stop(get(hsp_name));
|
|
|
+ );
|
|
|
+
|
|
|
+ ifnot(get(index) GT -1,
|
|
|
+ set(hotspot[get(hsp_name)].animatiedOn,0);
|
|
|
+ set(hotspot[get(hsp_name)].visible,true);
|
|
|
+ set(hotspot[get(hsp_name)].frames,get(frameNumber));
|
|
|
+ calc(frameRate, duration / frameNumber);
|
|
|
+
|
|
|
+ set(hotspot[get(hsp_name)].frameRate,get(frameRate));
|
|
|
+
|
|
|
+ trace('frameRate::',get(frameRate));
|
|
|
+ trace('frameNumber::',get(frameNumber));
|
|
|
+ trace('framewidth::',get(framewidth));
|
|
|
+ trace('duration::',get(duration));
|
|
|
+ set(hotspot[get(hsp_name)].xframes,1);
|
|
|
+ set(hotspot[get(hsp_name)].yframes,1,get(frameNumber));
|
|
|
+ crop_animation_reapply(get(hsp_name),get(frameRate),get(framewidth),get(frameNumber));
|
|
|
+ <!-- do_crop_animation(get(hsp_name),get(frameRate),get(frameNumber)); -->
|
|
|
+ <!-- do_crop_animation(get(framewidth),get(framewidth),get(frameNumber));"); -->
|
|
|
+ );
|
|
|
+ );
|
|
|
+
|
|
|
+ set(hotspot[get(hsp_name)].url,get(iconUrl));
|
|
|
+ set(hotspot[get(hsp_name)].rotate,0);
|
|
|
+ set(layer[get(hsLabel)].rotate,0);
|
|
|
+ set(layer[get(hsDot)].visible,false);
|
|
|
+
|
|
|
+ );
|
|
|
+
|
|
|
+
|
|
|
+</action>
|
|
|
+
|
|
|
+<action name="dragJQlayer">
|
|
|
+ txtadd(hsName, '', get(name));
|
|
|
+ txtreplace(hsName, 'tooltip_', '');
|
|
|
+ txtreplace(hsName, 'tooldot_', '');
|
|
|
+ <!-- copy(drag_currentx, x);
|
|
|
+ copy(drag_currenty, y);
|
|
|
+ copy(drag_stagex, mouse.stagex);
|
|
|
+ copy(drag_stagey, mouse.stagey);
|
|
|
+ indexoftxt(align_contains_right, get(align), 'right');
|
|
|
+ indexoftxt(align_contains_bottom, get(align), 'bottom');
|
|
|
+ calc(drag_align_x, align_contains_right GE 0 ? -1 : +1);
|
|
|
+ calc(drag_align_y, align_contains_bottom GE 0 ? -1 : +1);
|
|
|
+ -->
|
|
|
+
|
|
|
+ copy(hath, hotspot[get(hsName)].ath);
|
|
|
+ copy(hatv, hotspot[get(hsName)].atv);
|
|
|
+ spheretoscreen(hath, hatv, hotspotcenterx, hotspotcentery, 'l');
|
|
|
+ sub(drag_adjustx,mouse.stagex, hotspotcenterx);
|
|
|
+ sub(drag_adjusty,mouse.stagey, hotspotcentery);
|
|
|
+
|
|
|
+ asyncloop(
|
|
|
+ <!-- 计算热点中心点 -->
|
|
|
+ pressed,
|
|
|
+ sub(dx, mouse.stagex, drag_adjustx);
|
|
|
+ sub(dy, mouse.stagey, drag_adjusty);
|
|
|
+ screentosphere(dx, dy, ath, atv);
|
|
|
+ <!-- 更新 -->
|
|
|
+ copy(hotspot[get(hsName)].ath, ath);
|
|
|
+ copy(hotspot[get(hsName)].atv, atv);,
|
|
|
+ set(global.ath,get(ath));
|
|
|
+ set(global.atv,get(atv));
|
|
|
+ );
|
|
|
+
|
|
|
+</action>
|
|
|
+
|
|
|
+<action name='JQlayerClick'>
|
|
|
+ txtadd(clickName, '', get(name));
|
|
|
+ txtreplace(clickName, 'tooltip_', '');
|
|
|
+ txtreplace(clickName, 'tooldot_', '');
|
|
|
+ <!-- trace('JQlayerClick',get(clickName)); -->
|
|
|
+ js(__krfn.utils.linkopen(get(hotlink),get(clickName)));
|
|
|
+</action>
|
|
|
+
|
|
|
+<action name="dragJQhotspot">
|
|
|
+ trace('dragJQhotspot::',ath,atv);
|
|
|
+
|
|
|
+ spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery, 'l');
|
|
|
+ sub(drag_adjustx,mouse.stagex, hotspotcenterx);
|
|
|
+ sub(drag_adjusty,mouse.stagey, hotspotcentery);
|
|
|
+
|
|
|
+ asyncloop(
|
|
|
+ pressed,
|
|
|
+ sub(dx, mouse.stagex, drag_adjustx);
|
|
|
+ sub(dy, mouse.stagey, drag_adjusty);
|
|
|
+ screentosphere(dx, dy, ath, atv);
|
|
|
+ );
|
|
|
+</action>
|
|
|
+</krpano>
|