actionname(parameters); ...
a OPERATOR b
(a OPERATOR b) OPERATOR (c OPERATOR d)
== | is equal (non-strict) |
!= | is not equal (non-strict) |
< or LT | is lower than * |
> or GT | is greater than * |
<= or LE | is lower or equal than * |
>= or GE | is greater or equal than * |
=== | is equal (strict) |
!== | is not equal (strict) |
|| or OR | the left OR the right expression need to be true * |
&& or AND | the left AND the right expression need to be true * |
! | NOT operator - invert a boolean value |
if ? then : else | Ternary operator |
( ... ) | Nesting operator |
+ | plus - add numbers or concatenate strings |
- | minus |
* | multiple |
/ | divide |
^ | power of |
<< or LSHT | left bit shift * |
>> or RSHT | right bit shift * |
BOR | bitwise OR |
BAND | bitwise AND |
XOR | bitwise XOR |
<array_name name="item_name" value="..." />
array_name[item_name].value
Variable name | type | default value | |
global local |
Object Object |
||
---|---|---|---|
The global object allows directly accessing the global variable scope. The usage of global can be necessary inside local- or layer/hotspot scope code to be able to access a global variable when a variable with the same name is already defined the current scope. The local object is only available inside local-scope actions and allows directly accessing the current local variable scope. This can be used to ensure defining new variables at the local scope when there might be already global variables with the same names. |
|||
Variable name (read only) | type | default value | |
version | String | "1.19-pr16" | |
The krpano version string. | |||
Variable name (read only) | type | default value | |
xmlversion | String | ||
The version setting from the xml. When not set, this will be the same as the krpano version string. |
|||
Variable name (read only) | type | default value | |
build | String | "2018-04-04" | |
The krpano build date string in the format YYYY-MM-DD. | |||
Variable names (read only) | type | default value | |
mouse.x mouse.y mouse.stagex mouse.stagey mouse.downx mouse.downy mouse.clickx mouse.clicky |
int int int int int int int int |
||
The mouse position. The mouse.x and mouse.y coordinates are relative to the left top edge of the area. The mouse.stagex and mouse.stagey coordinates are relative to the left top edge of the whole stage / screen / window. The mouse.downx and mouse.downy variables store the position where the mouse button was last pressed down (for left and right buttons). The coordinates itself are relative to the left top edge of the area. The mouse.clickx and mouse.clicky variables are special case ones - they store the position where the click from onsingleclick or ondoubleclick events had happend. The coordinates itself are relative to the left top edge of the area. |
|||
Variable name (read only) | type | default value | |
keycode | int | 0 | |
The keycode of the last pressed or released key. The keycode value will be set in the onkeydown and onkeyup events. Here a small code snippet to find out the keycode of the pressed key: <events onkeydown="showlog(); trace('keycode=',keycode);" /> |
|||
Variable names (read only) | type | default value | |
wheeldelta wheeldelta_raw wheeldelta_touchscale |
int Number Number |
0 Number.NaN 0.0 |
|
The roll-delta of the mouse wheel rotation. These variables will be set in the onmousewheel event.
|
|||
Variable name | type | default value | |
fullscreen | Boolean | false | |
The fullscreen variable can be used to check or to change the current state of the fullscreen mode.
When the variable will be changed, then also the fullscreen mode will be changed. Example - switch to fullscreen mode: onclick="set(fullscreen,true);"Example - switch between fullscreen and windowed mode: onclick="toggle(fullscreen);" Notes:
|
|||
Variable names (read only) | type | default value | |
stagewidth stageheight |
int int |
||
The sizes of the current viewer window in pixels. Get the these sizes in the onresize event. |
|||
Variable name (HTML5 only) | type | default value | |
stagescale | Number | 1.0 | |
A global overall scaling setting. The stagescale setting will scale all krpano elements and sizes. By scaling all elements, the krpano stage-size (screen-size / resolution) itself will be scaled inversely by this value - e.g. a value of 0.5 will scale-down all elements by 50% while increasing the internal stage-sizes by 200% at the same time. The default stagescale value depends on the device, the browser, the Javascript window.devicePixelRatio value. On desktop and tablets browsers the default value will be typically 1.0, on mobiles typically 0.5. That means the elements on mobiles are typically half the size as on desktop or tablets. To disable that behavior (e.g. to implement some custom responsive layout) add this code to the first xml: <action name="mobilescale" autorun="preinit" devices="mobile"> |
|||
Variable name (read only) | type | default value | |
browser.useragent browser.platform browser.location browser.domain browser.protocol |
String String String String String |
||
Information about the browser.
|
|||
Variable names (read only) | type | default value | |
device.flash device.flashversion device.html5 device.desktop device.normal device.tablet device.mobile device.handheld device.css3d device.webgl device.multiressupport device.panovideosupport device.fullscreensupport device.pixelratio device.fractionalscaling device.mouse device.touch device.ios device.iosversion device.iphone device.ipod device.ipad device.android device.androidversion device.androidstock device.chrome device.chromemobile device.chromeversion device.firefox device.firefoxversion device.ie device.ieversion device.edge device.safari device.safariversion device.opera device.operaversion device.standalone device.windows device.mac device.linux |
Boolean Number Boolean Boolean Boolean Boolean Boolean Boolean Boolean Boolean Boolean Boolean Boolean Number Boolean Boolean Boolean Boolean Number Boolean Boolean Boolean Boolean Number Boolean Boolean Boolean Number Boolean Number Boolean Number Boolean Boolean Number Boolean Number Boolean Boolean Boolean Boolean |
false false false false false false false false false false false false 1.0 false false false false false false false false false false false false false false false false false false false false |
|
The device object provides information about the current device/system.
It's the dynamic/scripting equivalent to the xml devices attribute. The attributes/properties of the device object can be checked anytime by scripting code, e.g. by the if() action. The device object has these properties:
if(device.html5, ...); if(device.flash, ...); if(device.android, if(device.flash, ...); ); if(device.iOSversion GT 5.1, ...); |
|||
Variable name (read only) | type | default value | |
timertick | int | ||
The timertick variable returns the number of milliseconds that have elapsed since the viewer was started (1000 milliseconds = 1 second). | |||
Variable name (read only) | type | default value | |
random | Number | 0.0 - 1.0 | |
The random variable returns a random number in the range 0.0 to 1.0. Example - how to get an integer random value in the range 1 - 10: mul(val, random, 9); add(val, 1); roundval(val); trace('random value=',val); |
|||
Variable names | type | default value | |
hlookat_moveforce vlookat_moveforce fov_moveforce |
Number Number Number |
0.0 0.0 0.0 |
|
These variables can be used to set a force to move the view / the pano. Their main usage is for keyboard or button movement control. When they will be set to a value other than 0.0, the view will start slowly accelerating (controlled by control.keybaccelerate) and then move with a maximum speed (controlled by control.keybspeed) until they will be set back to 0.0, then the movement will slow down (controlled by control.keybfriction). |
|||
Variable name (read only) | type | default value | |
multireslevel | int | ||
The multireslevel variable returns the current multi-resolution level (0 - image.level.count). |
|||
Variable name | type | default value | |
lockmultireslevel | String | -1 | |
Lock the automatic multi-resolution level selection to a fixed level. Set lockmultireslevel to "current" to lock the level to the current level. To release the level locking set lockmultireslevel back to "-1". |
|||
Variable name | type | default value | |
downloadlockedlevel | Boolean | false | |
When set to true, the currently locked level will be downloaded completely. | |||
Variable name | type | default value | |
progress.progress | Number | 0.0 | |
The current loading progress as linear value from 0.0 to 1.0. It could be used to create custom loading animations - e.g. use the onxmlcomplete event for starting the loading animation, and the onloadcomplete event for stopping it. |
|||
Variable name | type | default value | |
network.viewerpath network.htmlpath network.firstxmlpath network.currentxmlpath |
String String String String |
||
Path to several locations (the path only, without filename):
|
|||
Variable name (read only) | type | default value | |
xml.url | String | ||
The xml.url variable contains the path/url of the currently loaded xml file. | |||
Variable name (read only) | type | default value | |
xml.content | String | ||
The xml.content variable contains the whole content of the currently loaded xml file as string. After loading a <scene> with the loadscene() action, the xml.content variable will contain only the content of the <scene> element. | |||
Variable name (read only) | type | default value | |
xml.scene | String | ||
The xml.scene variable contains the name of currently loaded scene. | |||
Variable name (read only) | type | default value | |
xml.view | Object | ||
A backup of the values from the initial <view> element defined in the current xml or scene.
E.g. get the initial view.hlookat value via xml.view.hlookat. Note - only the values that were defined in the xml are stored here, no default values. That means before using a value from that object, it would be necessary to check if these variables actually exists - e.g. via if(xml.view.fov !== null, ...);. |
|||
Variable name (read only) | type | default value | |
lasterror | String | ||
The lasterror variable contains the last error message when an error had happened. To get this variable the onloaderror event must be used. | |||
Variable name (read only) | type | default value | |
haveexternalinterface | Boolean | true | |
This variable can be used to check if the External Interface from the Flashplayer is available.
This interface is necessary for the Javascript Interface and for the
openurl actions. Online on a server the External Interface is always available, but locally only when Flash file will be opened inside the Browser and when the folder of the Flash swf is in a 'trusted folder'. The trusted folders can be managent in the Flashplayer security settings, see here for more detatils - Local / Offline Usage. |
|||
Variable name (read only) | type | default value | |
havenetworkaccess | Boolean | true | |
This variable can be used to check if the Network Access is available in the Flashplayer.
This can be used to avoid errors when trying to use plugins like the Google Maps or Bing Maps locally, because these
plugins are trying to load data from the web and so need Network Access. Online on a server the Network Access is always available, but locally only when the folder of the Flash swf is in a 'trusted folder'. The trusted folders can be managent in the Flashplayer security settings, see here for more detatils - Local / Offline Usage. |
def(variable, type, value*)
def(b, boolean, true);
def(n, number, 123.456);
def(s, string, 'text');
def(obj, object);
def(obj.x, number, 0.0);
def(obj.y, number, 0.0);
set(variable, value)
set(object, variable:type=value, variable:type=value, ...)
set(var1, 'hello');
set(var2, get(var1));
set(fullscreen, true);
set(layer[p1].visible, false);
set(hotspot[h1].scale, 2.5);
set(contextmenu.item[0].caption, 'hello item');
set(events.onxmlcomplete, null);Multiple set:
set(layer[p1], visible=false, alpha=0.5);
set(hotspot[hs1], type='text', ath=0.0, atv=0.0, html='Test Text', css='text-align:center', bg=false );
set(global, test='Test text', havesomething:boolean=true, var2:string=get(var1), value:number=calc(1 + 2*3) );
action( get(variable), ... )
array[ get(variable) ]
<xmlelement attribute="get:variable" ... />
set(dstvar, get(srcvar));
looktohotspot(get(name));
lookto(get(h), get(v), get(f));
showtext(get(msg));
tween(var,get(dstval));
set(pic, spot1); set(hotspot[get(pic)].visible, false);
trace('xyz=', xyz, ' get(xyz)=', get(xyz));
txtadd(msg, 'fov=', get(view.fov));
calc(variable, expression)
action( calc(expression), ... )
array[ calc(expression) ]
<xmlelement attribute="calc:expression" ... />
set(y_new, calc(y_old - offset1 + offset2));
set(animationtime, calc('%1' == 'instant' ? 0.0 : 0.5));
<layer url="calc:'%CURRENTXML%/skin/' + settings.image1" />
copy(destination, source, typeconversion*)
copy(dstvar, srcvar);
copy(cur_hlookat, view.hlookat);
copy(layer[text].x, mouse.x); copy(layer[text].y, mouse.y);
delete(variable, ...)
set(tmp1, ...); set(tmp2, ...); ... do something ... delete(tmp1, tmp2);
if(condition, then-actions, else-actions*)4 or more parameter call:
if( condition, then-actions, else-if-condition, then-actions, else-if-condition, then-actions, ... else-actions )
if(fullscreen, fullscreensetup(), windowsetup() );
if(fullscreen, set(layer[controls].visible, false) );
if(i LT 10, loop(next) );
if(var === null, set(var,0));
if(hotspot[spot1] === null, trace(there is no spot1 hotspot));
if((varA GT 5) AND (varA LT 10), trace('varA is between 5 and 10') );
if(varA AND varB AND varC, trace('all vars are true') );
if(var1 GT var2, trace('condition is true'); lookto(100,20,50); , trace('condition is false'); lookto(0,0,100); );
if(a*2+b GT (c+3)*1.5 OR teststring == '123', ...);
if( test == 1, trace('test is 1'), test == 2, trace('test is 2'), test == 3, trace('test is 3'), trace('test is someting else') );
delayedcall(delay, actions)
delayedcall(id, delay, actions)
delayedcall(5.0, hidelogo() );
delayedcall(10, looktohotspot(spot1);loadpano(pano2.xml); );
delayedcall(1, showtext('hello'); ); delayedcall(4, showtext('to the pano'); );
<action name="updatemousepos"> copy(layer[cursor].x, mouse.x); copy(layer[cursor].y, mouse.y); delayedcall(0.02, updatemousepos() ); </action>
stopdelayedcall(id)
<events name="introimage_events" onnewpano="delayedcall(introimage, 5.0, hide_introimage() );" onremovepano="stopdelayedcall(introimage);" />
nexttick(actions)
callwhen(condition, actions)
callwhen(id, condition, actions)
callwhen(plugin[video].loaded, plugin[video].playvideo(...); );
callwhen(plugin[maps].loaded, plugin[maps].setcenter(...); );
stopcallwhen(id)
for(startactions, condition, nextactions, loopactions)
for(set(i,0), i LT 10, inc(i), trace('i=',i) );.
for(set(i,0), i LT layer.count, inc(i), trace('layer[',i,'].name=',layer[get(i)].name); );
loop(condition, loopactions)
asyncloop(condition, loopactions, doneactions*)
ondown="asyncloop(pressed, layer[scrollarea].scrollby(+2,0) );"
onover="asyncloop(hovering, updatemousepos(), hideinfo() );"
asyncloop(true, framehandler() );
setinterval(id, delay, actions)
clearinterval(id)
setinterval(time, 1.0, jsget(time, (new Date()).toLocaleTimeString(); ); trace('time=',time); );
<events onkeydown="setinterval(get(keycode), 0.1, trace(keycode); );" onkeyup="clearinterval(get(keycode));" />
toggle(variable)
toggle(fullscreen);
toggle(layer[button1].visible);
switch(variable)
switch(variable, value1, value2, ...)
switch(fullscreen);
switch(layer[button1].visible);
switch(layer[button1].alpha, 1.0, 0.5);
switch(layer[child].parent, button1, button2, button3);
switch(destpos, -100, 0, +100); tween(y,get(destpos));
exitcall()
callwith(caller, actions)
callwith(layer[test], onclick);
callwith(layer[test], trace('test pos=',x,'/',y); );
callwith(layer[test], tween(alpha, 0.0); );
scope(scope, actions)
scope(localonly, for(set(i,0), i LT 10, inc(i), trace(i)); );
scope(private:my_xml_plugin, trace(internal_var); );
parentscopeset(variable, value)
assignstyle(elementname, styles)
assignstyle(layer[test], 'teststyle');
assignstyle(layer[test], 'style1|style2');
copyattributes(destobject, srcobject)
copyattributes(get(layer[test]), get(style[style1]));
events.dispatch(eventname, instantly*)
<events name="events1" myevent="trace(events1...);" /> <events name="events2" myevent="trace(events2...);" /> ... events.dispatch(myevent);
add(variable, valueA, valueB*)
sub(variable, valueA, valueB*)
mul(variable, valueA, valueB*)
div(variable, valueA, valueB*)
mod(variable, valueA, valueB*)
pow(variable, valueA, valueB*)
set(val, 1); add(val, 1); trace('val should be 2: val=',val);
mul(doublewidth, width, 2.0);
mul(scale, 0.5);
div(result, vala, valb);
add(dst,rotate,360); tween(rotate,get(dst),5);
add(xpos, mouse.x, mouse_x_offset);
sub(destx, stagewidth, destwidth);
div(aspect,16,9);
mod(cur_hlookat,cur_hlookat,360);
pow(sqrt,val,0.5);
inc(variable, byvalue*, max*, min*)
dec(variable, byvalue*, min*, max*)
inc(i);
inc(frame,1,get(lastframe),0);
inc(ypos,30);
inc(view.hlookat, 2, 90, 90);
clamp(variable, min, max)
clamp(percent, 0, 100);
screentolayer(bar, mouse.stagex,mouse.stagey, lx,ly);
div(fill, lx, layer[bar].pixelwidth);
mul(fill, 100);
clamp(fill, 0, 100);
txtadd(layer[barfill].width, get(fill), '%');
Math.*
roundval(variable, decimalplaces*)
roundval(destinationvariable, variable, decimalplaces)
roundval(val);
roundval(val, 2);
roundval(hlookat_print, view.hlookat, 2);
copy(cur_hlookat,view.hlookat); mod(cur_hlookat,360); roundval(cur_hlookat,2); copy(cur_vlookat,view.vlookat); roundval(cur_vlookat,2); txtadd(msg,'looking at ',get(cur_hlookat),'/',get(cur_vlookat));
tohex(variable, prefix*, length*)
tohex(destinationvariable, variable, prefix, length)
tohex(color,'#',6);
set(color, ...an_external_integer_input...);
tohex(color,'#',6);
txtadd(layer[text1].css,'color:',get(color),';');
tolower(variable)
toupper(variable)
tolower(destinationvariable, sourcevariable)
toupper(destinationvariable, sourcevariable)
txtadd(destination, txt1, txt2*, txt3*, ...)
txtadd(picfilename,'%CURRENTXML%/pic_',get(pic),'.jpg');
txtadd(crop,'0|',get(ypos),'|333|285');
txtadd(pname, 'thumbbar_image_', get(i));
txtadd(layer[text].html,'[p]',get(data[txt1].content),'[/p]');
txtadd(msg,get(view.fovtype),'=',get(fov),'°');
subtxt(dstvar, srcvar, startpos, len)
indexoftxt(index, txt, searchtxt, startindex*)
txtreplace(var, searchtext, replacetext)
txtreplace(dstvar, srcvar, searchtext, replacetext)
txtsplit(string, separator, resultingarray)
txtsplit(string, separator, var1, var2, ...)
txtsplit('1|2|3', '|', a, b, c);Result:
trace('a=',get(a), ' b=',get(b), ' c=',get(c));
a=1 b=2 c=3
txtsplit('x|y|z', '|', arr);Result:
for(set(i,0), i LT arr.count, inc(i),
trace('arr[',get(i),'].value=',arr[get(i)].value);
);
arr[0].value=x
arr[1].value=y
arr[2].value=z
fromcharcode(var, charcode)
escape(var)
escape(var, text)
unescape(var)
unescape(var, text)
tween(variable, value, time*, tweentype*, donecall*, updatecall*)
tween(scale,2);
tween(rotate,90);
tween(width,50%);
onover="tween(alpha,0.7,distance(0.3,0.2));" onout="tween(alpha,1.0,distance(0.3,0.2));"
set(alpha,0); set(visible,true); tween(alpha, 1.0 ,0.3);
tween(layer[logo].width, get(destwidth));
set(layer[image].enabled,false); tween(layer[image].alpha,0.0,0.5,default,removeplugin(image));
set(view.stereographic,true); tween(view.vlookat, 90.0, 2.0); tween(view.fisheye, 1.0, 2.0); tween(view.fov, 150.0, 2.0);
stoptween(variable, ...)
ondown="tween(layer[text].y, 10, distance(400,0.7), linear);" onup="stoptween(layer[text].y);"
loadpano(xmlpath, vars*, flags*, blend*)
loadscene(scenename, vars*, flags*, blend*)
loadpanoscene(xmlpath, scenename, vars*, flags*, blend*)
loadxml(xmlstring, vars*, flags*, blend*)
NOBLEND
BLEND(time, tweentype)
(WebGL only)COLORBLEND(time, color, tweentype)
(WebGL only)LIGHTBLEND(time, color, colorscale, tweentype)
(WebGL only)SLIDEBLEND(time, angle, smooth, tweentype)
(WebGL only)OPENBLEND(time, shape, smooth, zoom, tweentype)
(Flash or WebGL only)ZOOMBLEND(time, zoom, tweentype)
loadpano(pano2.xml);
loadpano(pano2.xml, null, MERGE, BLEND(1));
loadscene(scene1);
loadscene(scene1, null, MERGE, BLEND(1));
loadxml('<krpano><image><sphere url="pano.jpg"/></image></krpano>');
loadxml(get(data[xml].content), null, KEEPALL);
loadpano('%SWFPATH%/pano.xml', null, MERGE, BLEND(2));
loadpano(sphere.xml, image.hfov=1.0&view.limitview=fullrange);
openurl(url, target*)
openurl('https://krpano.com',_self);
openurl('help.html');
lookat(h, v, fov*, distortion*, architectural*, pannini*)
lookat(0,0);
lookat(0,0,90);
loadpano(pano.xml); lookat(45.1, -20.2, 110.0);
lookto(toH,toV,fov*,motiontype*,shortestway*,nonblocking*,donecall*)
looktohotspot(hotspotname*, fov*, motiontype*, shortestway*)
moveto(toH, toV, motiontype*)
zoomto(fov, motiontype*)
moveto(100.0,5,linear(10));
zoomto(130,smooth());
lookto(33,-22,30,smooth(100,50,20));
looktohotspot(hotspot1);
looktohotspot(hotspot2, 40);
looktohotspot(hotspot3, 25, smooth(100,50,20));
looktohotspot(get(name));
adjusthlookat(desthlookat)
adjusthlookat(140); tween(view.hlookat, 140);
getlooktodistance(result, toH, toV, fromH*, fromV*)
stoplookto()
stopmovements()
wait(parameter)
oninterrupt(break); lookto(150,30,70); wait(3); lookto(242,0,150); lookto(280,-10,50); wait(3);
loadpano(pano2.xml,null,MERGE,BLEND(2)); lookat(100,50,5); wait(BLEND); lookto(100,50,150);
oninterrupt(actions)
oninterrupt(break); lookto(150,30,70); wait(3); lookto(242,0,150); lookto(280,-10,50); wait(3);
oninterrupt( trace(user interrupt); ); lookto(0,0,90); lookto(90,0,90); lookto(180,0,90); lookto(270,0,90); lookto(0,0,90);
screentosphere(x,y, h,v)
spheretoscreen(h,v, x,y, stereoside*)
screentosphere(mouse.x, mouse.y, toh, tov);
screentolayer(layer, screenx,screeny, layerx,layery)
layertoscreen(layer, layerx,layery, screenx,screeny)
screentolayer(bar, mouse.stagex,mouse.stagey, lx,ly);
div(fill, lx, layer[bar].pixelwidth);
mul(fill, 100);
clamp(fill, 0, 100);
txtadd(layer[barfill].width, get(fill), '%');
remapfovtype(fov, srcfovtype, dstfovtype)
remapfovtype(fov, srcfovtype, dstfovtype, width, height)
set(view.fovtype, HFOV); set(view.fov, 90); ... set(view.fovtype, VFOV); remapfovtype(view.fov, HFOV, VFOV);
showtext(text, textstyle*)
updateobject(updateall*, updatefov*)
set(image.hfov,1); updateobject(true,true);
updatescreen()
invalidatescreen()
addlayer(name)
addplugin(name)
addhotspot(name)
addlensflare(name, ath*, atv*)
addlayer(button); set(layer[button].url,button.jpg); set(layer[button].align,bottom); set(layer[button].x,10); set(layer[button].y,20); set(layer[button].onhover,showtext('hovering the new button')); set(layer[button].onclick, removelayer(button) );
addhotspot(newspot); set(hotspot[newspot].url,spot.png); set(hotspot[newspot].ath,150); set(hotspot[newspot].atv,30); set(hotspot[newspot].scale,0.7); set(hotspot[newspot].zoom,true); set(hotspot[newspot].onclick, removehotspot(newspot) );
addhotspot(polyspot); set(hotspot[polyspot].fillalpha, 0.25); set(hotspot[polyspot].borderalpha, 0.50); set(hotspot[polyspot].onclick, removehotspot(polyspot) ); set(hotspot[polyspot].point[0].ath,-10); set(hotspot[polyspot].point[0].atv,-10); set(hotspot[polyspot].point[1].ath,-10); set(hotspot[polyspot].point[1].atv,+10); set(hotspot[polyspot].point[2].ath,+10); set(hotspot[polyspot].point[2].atv,+10); set(hotspot[polyspot].point[3].ath,+10); set(hotspot[polyspot].point[3].atv,-10);
addlensflare(sun, 20, -60); set(lensflare[sun].set, FLARESET2); set(lensflare[sun].size, 0.7);
removelayer(name, removechildren*)
removeplugin(name, removechildren*)
removehotspot(name)
removelensflare(name)
js( JavascriptFunction(parameters) )
function test(p1, p2, p3) { alert(p1 + ": " + p2 + " / " + p3); }
js( test('Lookat', get(view.hlookat), get(view.vlookat)) );
jscall( ...any Javascript code... )
jscall('document.getElementById("test").style.display="none";');
jscall(calc('console.log("krpano version: ' + version + '")'));
jscall('history.back()');
jsget(variable, ...Javascript code... )
jsget(ret, 'location.href');
trace('location=', get(ret));
jsget(passwort, 'prompt("Enter Password")');
if(password == 'hidden', ...);
jsget(date, 'new Date().toISOString().slice(0,10);');
trace('date=', get(date));
showlog(state*, position*)
debugvar(varname)
debug(...)
trace(...)
warning(...)
error(...)
trace('view.maxpixelzoom=', view.maxpixelzoom);
<events onkeydown="trace('keycode=',keycode);" />
onresize="trace('size=',stagewidth,'x',stageheight);"
onclick="trace('mouse clicked at ', mouse.x, ' / ', mouse.y);"
trace('xyz=',xyz,' get(xyz)=',get(xyz));
fatalerror(errormessage)