The krpano XML structure
krpano uses simple XML files for storing the panorama settings.
These files can be written or edited with a normal texteditor,
but the xml-syntax-rules must be respected!
For more informations about the basic XML syntax look here:
http://www.w3schools.com/xml/xml_syntax.asp
The schematic base structure is as follow:
<krpano attributes>
<image attributes> ... </image>
<preview attributes />
<display attributes />
<view attributes />
<control attributes />
<contextmenu attributes />
<autorotate attributes />
<progress attributes />
<network attributes />
<memory attributes />
<action attributes> ... </action>
<events attributes />
<security attributes />
<textstyle attributes />
<hotspot attributes> ... </hotspot>
<plugin attributes />
<lensflareset attributes> ... </lensflareset>
<lensflare attributes />
<include attributes />
<data attributes> ... </data>
</krpano>
The root node is <krpano>. Within this node there are all other
child nodes. "attributes" is a placeholder for the attributes of the node.
NOTES for the "url" attribute:
- the "url" attribute is a special one
- the paths defined with it, are relative to XML file where it was defined
- for plugins it is also possible to use the placeholders from the krpano basedir attribute
Description of all nodes
<krpano>
the root node of a krpano xml file
attributes:
- version
krpano version used to create this file, current is "1.0.6"
- onstart
action that will performed at the start of the viewing.
- basedir (Version 1.0.6 and higher)
base directory for the loadpano action commands.
this can be a relative or a absolute path,
the path can include this placeholders:
- %FIRSTXML% - path of the first loaded xml file
- %CURRENTXML% - path of the current loaded xml file
- %SWFPATH% - path of the swf file
- %HTMLPATH% - path of the html file
the defaultvalue is "%FIRSTXML%"
VERSION NOTES / UPDATE NOTES:
the behavior of version older than 1.0.6 can be restored by setting
"basedir" to "%CURRENTXML%"
- logkey (Version 1.0.6 and higher)
disable the 'O' key, which switch the log window on/off
allowed values: "true" or "false", default is "true"
note: this parameter is only checked once at startup
example code:
<krpano version="1.0" onstart="moveto(0,0);">
...
</krpano>
<image>
The panorama image settings.
Specifiy the type of the panorama and sets the paths to the images.
attributes:
- type - type of the panorama image (must be defined)
allowed values:
SPHERE - for spherical/equirectangular panorama images
CUBE - for six single cube side images
CUBESTRIP - the six cube images in one image strip
Depending on type there are different child-nodes:
Child nodes for type="SPHERE"
Child nodes for type="CUBE"
Child nodes for type="CUBESTRIP"
- tiled
is the image tiled or not
"true" or "false", default="false"
if tiled="true" then the url of the image should have placeholders for the tileindex
placeholders:
for the horizontal tile index: %u, %x, %h or %c
for the vertical tile index: %v, %y or %r
there can be one or more "0" between the "%" and the "u,x,c,v,y,r" to align the number and fill the space with 0's.
examples:
tile_%y_%x.jpg ->
tile_1_1.jpg, tile_1_2.jpg, ... tile_8_16.jpg
tile_%0y_%0x.jpg ->
tile_01_01.jpg, tile_01_02.jpg, ... tile_08_16.jpg
tile%00V%00U.jpg ->
tile001001.jpg, tile001002.jpg, ... tile008016.jpg
- tiledimagewidth
image width of the whole tiled image
- tiledimageheight
image height of the whole tiled image
- tilesize
width and height of the tiles,
a good compromise between loading overhead and tile imagesize are a tilesizes from around 500 to 1500.
- baseindex
numbering start index of the tiles, default=1
- multires
multiresolution images - only for SPHERE or CUBE images
Child nodes for multiresolution images
- multiresthreshold (Version 1.0.6 and greater)
threshold when to switch from one multiresolution level to the next
0..1, default = 0.1
example codes:
<image type="SPHERE">
<sphere url="sphereimage.jpg" />
</image>
<image type="SPHERE"
tiled="true"
tiledimagewidth="8192"
tiledimageheight="4096"
tilesize="1024"
>
<sphere url="sphere_tiles_%v_%u.jpg" />
</image>
<image type="CUBE">
<left url="left.jpg" />
<front url="front.jpg" />
<right url="right.jpg" />
<back url="back.jpg" />
<up url="up.jpg" />
<down url="down.jpg" />
</image>
Child nodes for <image type="SPHERE">
Settings for a sphere panorama image.
Child nodes:
<image type="SPHERE">
<sphere attributes />
</image>
attributes for sphere:
- url
path to the sphere image
example code:
<image type="SPHERE">
<sphere url="sphereimage.jpg" />
</image>
Child nodes for <image type="CUBE">
Settings for a cube panorama image. A cube panorama have six single images.
One for every cube-side.
Child nodes:
<image type="CUBE">
<left attributes />
<front attributes />
<right attributes />
<back attributes />
<up attributes />
<down attributes />
</image>
attributes for left/front/right/back/up/down:
- url
path to the image of a cube side
- rotate
rotate the image - rotation in degrees, default="0"
- flip
flip/mirror the image over the X and/or Y axis
allowed values: "X" or "Y" or "XY" or "none", default="none"
NOTE: the rotate and flip attributes do not work for tiled images
example codes:
<image type="CUBE">
<left url="left.jpg" />
<front url="front.jpg" />
<right url="right.jpg" />
<back url="back.jpg" />
<up url="up.jpg" />
<down url="down.jpg" />
</image>
<image type="CUBE">
<left url="left.jpg" />
<front url="front.jpg" />
<right url="right.jpg" />
<back url="back.jpg" />
<up url="up.jpg" rotate="-90" />
<down url="down.jpg" rotate="+90" />
</image>
Child nodes for <image type="CUBESTRIP">
Settings for a cubestrip panorama image.
The six single images for a cube are merged into one big images.
The images could be ordered horizontally or vertically. That will be automatic detected.
Child nodes:
<image type="CUBE">
<cubestrip attributes />
<left attributes />
<front attributes />
<right attributes />
<back attributes />
<up attributes />
<down attributes />
</image>
attributes for cubestrip:
- url
path to the cubestrip image
attributes for left/front/right/back/up/down:
- strip
Order of the image in the strip (1-6)
Default values:
left="1", front="2", right="3", back="4", up="5", down="6"
- rotate
rotate the image - rotation in degrees, default="0"
- flip
flip/mirror the image over the X and/or Y axis
allowed values: "X" or "Y" or "XY" or "none", default="none"
NOTE: tiled or multiresolution cubestrips are not supported
example codes:
<image type="CUBESTRIP">
<cubestrip url="cubestrip.jpg" />
</image>
<image type="CUBESTRIP">
<cubestrip url="cubestrip.jpg" />
<left strip="2" rotate="-90" />
<front strip="1" />
<right strip="3" rotate="+90" />
<back strip="4" />
<up strip="6" rotate="+180" />
<down strip="5" rotate="-180" />
</image>
Child nodes for <image type="..." multires="true">
Settings for a multiresolution panorama image.
The tilesize is specificed on the <image> node.
The <image> node would have one ore more <level> child nodes.
For each <level> nodes the width and the height must be defined.
Within the <level> node - are the image definitions for sphere or cube images.
Child nodes for SPHERE images:
<image type="SPHERE" multires="true" tilesize="...">
<level attributes>
<sphere attributes />
</level>
<level attributes>
...
</level>
</image>
or for CUBE images:
<image type="CUBE" multires="true" tilesize="...">
<level attributes>
<left attributes />
<front attributes />
<right attributes />
<back attributes />
<up attributes />
<down attributes />
</level>
<level attributes>
...
</level>
</image>
attributes for level:
- tiledimagewidth
image width of the whole tiled image
- tiledimageheight
image height of the whole tiled image
- details (Version 1.0.6 and higher)
individual details setting for this level
- download - settings for downloading tiles:
- view - download only the tiles that are needed for the current view
- all - download all tiles of the current level (not recommended)
- auto - automatic, if imageheight is smaller than 2000 then all tiles are downloaded,
if greater only the ones for the current view (=default).
- decode - settings for decoding the downloaded tiles:
- view - decode only the tiles that are needed for the current view
- all - decode all tiles of the current level (not recommended)
- auto - automatic, if imageheight is smaller than 2000 then all tiles are decoded,
if greater only the ones for the current view (=default).
attributes for left/front/right/back/up/down and sphere:
example codes:
<image type="SPHERE" multires="true" tilesize="512">
<level tiledimagewidth="2048" tiledimageheight="1024">
<shpere url="tiles_2k_%0y_%0x.jpg" />
</level>
<level tiledimagewidth="4096" tiledimageheight="2048">
<shpere url="tiles_4k_%0y_%0x.jpg" />
</level>
<level tiledimagewidth="8192" tiledimageheight="4096">
<shpere url="tiles_8k_%0y_%0x.jpg" />
</level>
</image>
<image type="CUBE" multires="true" tilesize="512">
<level tiledimagewidth="1024" tiledimageheight="1024">
<left url="cube1024/left_%v_%u.jpg" />
<front url="cube1024/front_%v_%u.jpg" />
<right url="cube1024/right_%v_%u.jpg" />
<back url="cube1024/back_%v_%u.jpg" />
<up url="cube1024/up_%v_%u.jpg" />
<down url="cube1024/down_%v_%u.jpg" />
</level>
<level tiledimagewidth="2048" tiledimageheight="2048">
<left url="cube2048/left_%v_%u.jpg" />
<front url="cube2048/front_%v_%u.jpg" />
<right url="cube2048/right_%v_%u.jpg" />
<back url="cube2048/back_%v_%u.jpg" />
<up url="cube2048/up_%v_%u.jpg" />
<down url="cube2048/down_%v_%u.jpg" />
</level>
<level tiledimagewidth="4096" tiledimageheight="4096">
<left url="cube4096/left_%v_%u.jpg" />
<front url="cube4096/front_%v_%u.jpg" />
<right url="cube4096/right_%v_%u.jpg" />
<back url="cube4096/back_%v_%u.jpg" />
<up url="cube4096/up_%v_%u.jpg" />
<down url="cube4096/down_%v_%u.jpg" />
</level>
</image>
<preview>
(optional)
Panorama image that will be displayed while loading. Should be small!
- the image should be not too low res, but very smooth for good jpeg compression
- filesize should be small!
- sphere or cubestrip images are allowed
- alternatively you can display a gird sphere or cube
- default = no preview
attributes:
- type
- "SPHERE" (=default)
- "CUBESTRIP"
- "grid(...)" - a generated grid preview image
grid(type,xsteps,ysteps,res,lincol,bkcol,pntcol)
- type = SPHERE or CUBE (must be defined)
optional parameters:
- xsteps = horizontal distance between lines in pixels, default=10
- ysteps = vertical distance between lines in pixels, default=10
- res = resolution of gridimage, default=400
- lincol = color of lines in hex-format (default=0x666666)
- bkcol = background color (default=0x222222)
- pntcol = color of points (default=linecolor)
- url
the path to the preview image
can be a spherical/equirectangular image or
a vertical or horizonal cubestrip image
- striporder
order of the images in the cubestrip image (default="LFRBUP")
- details
rendering details (4-32), more details are more exact 3d-geometry, default=8
example codes:
<preview type="sphere" url="spherepreview.jpg" details="10" />
<preview type="cubestrip" url="cspreview.jpg" details="12" />
<preview type="grid(cube)" details="12" />
DEMO:
view some preview examples interactive
high quality preview images can be easily created with the
kmakepreview tool
<action>
(optional, Version 1.0.6 and higher)
a named collection of actions calls,
addtionally it's possible to pass parameters to the actions
this action can be called from events with:
"action(name,parameter1*,parameter2*,...*);"
*parameters are optional!
to access the parameters inside the action use %0-%9 placeholders:
%0 - is the name of the action itself
%1 - first parameter
%2 - second parameter
.. and so on ...
attributes:
notes:
- when loading a other xml file, all action tags remain unchanged unless they are defined again in the other xml.
then they will be overwritten with the new ones.
example code - move to a viewpoint and load a other pano
<action name="loadpano1">
lookto(88.517,1.097,6,smooth());
loadpano(next.xml,null,KEEPALL,BLEND(1));
lookat(180.8,1.9,22);
wait(blend);
lookto(263.711,0.982,87,smooth(100,20,50));"
</action>
<hotspot ...
onclick="action(loadpano1);"
/>
example code - fade a image in and out on hotspot over:
<action name="fadein">
set(plugin[%1].visible,true);
tween(plugin[%1].alpha,1);
</action>
<action name="fadeout">
tween(plugin[%1].alpha,0,,,set(plugin[%1].visible,false));
</action>
<plugin name="image1" ... alpha="0" />
<hotspot ...
onover="action(fadein,image1);"
onout="action(fadeout,image1);"
/>
<events>
(optional, Version 1.0.6 and higher)
set actions for special events
attributes:
- onenterfullscreen
this event is called when switching to fullscreen mode
- onexitfullscreen
this event is called when switching back from fullscreen mode
notes:
- when loading a other xml file, all settings in the event tag remain unchanged unless they are defined again in the other xml.
then the attributes will be overwritten with the new ones.
example code
<events onenterfullscreen="action(show_fs_interface);"
onexitfullscreen="action(hide_fs_interface);"
/>
<display>
(optional)
settings for the quality and performance
attributes:
- fps
framerate in frames per second, should be something between 30 and 100, default=60
- details
rendering details (4-32) more details is more exact 3d-geometry, default=16
- tessmode
tesslation mode, 1-5, default=5
- movequality
quality while moving - LOW or HIGH, default=LOW
- stillquality
quality while not moving - LOW or HIGH, default=HIGH
- stilltime
time in seconds after swtiching from "movequality" to "stillquality", default=0.25
example codes:
<display fps="40" details="18" />
<display details="20" movequality="LOW" stillquality="LOW" />
<view>
(optional)
viewing settings - looking direction - field of view - etc.
attributes:
- hlookat
horizontal look position in spherical coordinates (0 .. 360°), default="0"
- vlookat
vertical look position in spherical coordinates (-90 .. +90°), default="0"
- camroll
roll/rotation of camera (only when control.mousetype is "drag3d")
- fov
field of view (in degrees, 1 .. 179°), default="90"
- fovmin
minimum of fov, default="1"
- fovmax
maximum of fov, default="179"
- limitfov
limit fov to avoid displaying of the fisheye lens border, "true" or "false"
default="false"
Version 1.0.3 and higher - default="true"
- fisheye
fisheye effect, (0 - 1), default="0.35"
- fisheyefovlink
fov and fisheye are linked together (when zooming in - the fisheye effect will be reduced)
this value is the correlation of these values:
(0.0 - 3.0), 0=linear correlation, 3=dynamic correlation) - default="0.5"
for example: fov="180" and fisheye="1.0" will be a full 180° fisheye view
- architectural (Version 1.0.6 and higher)
architectural projection, (0 - 1), default="0.0" (=disabled)
set to "1.0" to enable architectural projection mode
- architecturalonlymiddle (Version 1.0.6 and higher)
do architectural projection only in the middle area, switch back to normal projection
on nadir / zenith views, "true" or "false", default="false"
NOTE - this parameter is only temporary, it may be changed in future versions
- limitview (Version 1.0.3 and higher)
possible values:
"off" - no limiting
"auto" - automatic limiting (default)
"range" - limit to the area set by "hlookatmin","hlookatmax","vlookatmin","vlookatmax"
"lookat" - limit the lookat angle to "hlookatmin","hlookatmax","vlookatmin","vlookatmax"
(when using range limiting the fisheye effect should be set to 0)
- hlookatmin (Version 1.0.3 and higher)
horizontal minimum look position in spherical coordinates (-180° .. +180°), default="-180"
(if (hlookatmax-hlookatmin) is 360 then there is no limiting)
- hlookatmax (Version 1.0.3 and higher)
horizontal maximum look position in spherical coordinates (-180° .. +180°), default="+180"
(if (hlookatmax-hlookatmin) is 360 then there is no limiting)
- vlookatmin (Version 1.0.3 and higher)
vertical minimum look position in spherical coordinates (-90° .. +90°), default="-90"
- vlookatmax (Version 1.0.3 and higher)
vertical maximum look position in spherical coordinates (-90° .. +90°), default="+90"
example code:
<view hlookat="150.0"
vlookat="-10.1"
camroll="0.0"
fov="120.0"
fovmin="30.0"
fovmax="160.0"
fisheye="0.35"
fisheyefovlink="0.55"
limitfov="true"
/>
<view hlookat="0" vlookat="0"
fov="120" fovmin="30" fisheye="0"
limitview="range"
vlookatmin="-45"
vlookatmax="+45"
/>
<control>
(optional)
mouse and/or keyboard controls settings
attributes:
- usercontrol
allowed control modes: "all" or "keyb" or "mouse" - default="all"
- mousetype
mouse control type:
"drag2d" or "drag3d" or "moveto" (default="drag2d)
drag2d = drag and drop panorama on a 2d axis
drag3d = drag and drop panorama on a 3d axis
moveto = mouse sets a move vector for viewing
- movetocursor
when mousetype = "moveto" - the mouse cursor type - "" or "vector" or "arrow", default=""
- cursorsize
when mousetype = "moveto" - size of the mouse cursor, default="10"
- mouseaccelerate
acceleration of moving, default="1.00"
- mousespeed
max. speed of moving, default="10.00"
- mousefriction
friction of moving, default="0.80"
- keybaccelerate
acceleration of moving, default="0.50"
- keybspeed
max. speed of moving, default="10.00"
- keybfriction
friction of moving, default="0.90"
- keybinvert
invert up and down - "true" or "false", default="false"
- mousefovchange
mouse wheel fov change in degrees, default="1.00"
- keybfovchange
keyboard fov change in degrees, default="1.00"
- fovspeed
max. fov change speed, default="3.00"
- fovfriction
fov change friction, default="0.90"
- keycodesleft
keycodes to move left, default="37" (cursor left)
- keycodesright
keycodes to move right, default="39" (cursor right)
- keycodesup
keycodes to move up, default="38" (cursor up)
- keycodesdown
keycodes to move down, default="40" (cursor down)
- keycodesin
keycodes to zoom in, default="16,65,107" (shift-key,A-key,plus-key)
- keycodesout
keycodes to zoom out, default="17,89,90,109" (ctrl-key,Y-key,Z-key,minus-key)
- headswing (Version 1.0.6 and higher)
swing/tilt head/view when fast moving left or right (moveto mode only)
this value sets the strength of this effect from 0 to 10 and higher
default="0" (=disabled)
example code:
<control usercontrol ="all"
mousetype ="drag2d"
movetocursor =""
cursorsize ="10.0"
mouseaccelerate="1.00"
mousespeed ="10.00"
mousefriction ="0.80"
keybaccelerate ="0.50"
keybspeed ="10.00"
keybfriction ="0.90"
keybinvert ="false"
mousefovchange ="1.00"
keybfovchange ="1.00"
fovspeed ="3.00"
fovfriction ="0.90"
/>
<contextmenu>
(optional, Version 1.0.6 and higher)
- changes the right click context menu
- add user defined items
- assign actions calls
- reorder the "About krpano..." item
attributes:
- fullscreen
show buildin "Fullscreen" / "Exit Fullscreen" item, "true" or "false", default="true"
- item (sub node)
context menu items
attributes:
- name
name/ id of this item, needed for get / set access
- caption
caption of the item, that will be shown in the contextmenu
special caption:
- use "KRPANO" to place the "About krpano..." item here
- if no "KRPANO" item was defined it will be added at the end
- separator
a separator bar should appear above the current item, true" or "false", default="false"
- enabled
state of the item, enabled or disabled, "true" or "false", default="true"
- visible
item visibility, "true" or "false", default="true"
- onclick
action event to call on click/select
example code:
<contextmenu fullscreen="false">
<item name="item1"
caption="About the Panorama..."
onclick="action(show_pano_info);"
/>
<item name="item2"
caption="About the Photographer..."
onclick="openurl(http://...);"
/>
<item name="item3"
caption="About this Hotspot..."
enabled="false"
/>
<item name="item4"
separator="true"
caption="Normal Projection"
onclick="set(view.fisheye,0);
set(view.architectural,0);
set(update,view);"
/>
<item name="item5"
caption="Fisheye Projection"
onclick="set(view.fisheye,0.35);
set(view.architectural,0);
set(update,view);"
/>
<item name="item6"
caption="Architectural Projection"
onclick="set(view.fisheye,0.0);
set(view.architectural,1.0);
set(update,view);"
/>
<item name="item7"
separator="true"
caption="KRPANO"
/>
</contextmenu>
<autorotate>
(optional, Version 1.0.4 and higher)
Automatic rotation/moving/zooming when no user-interaction.
attributes:
- enabled
"true" or "false" (default="false")
- waittime
time in seconds to wait after last user-interaction (default="1.5")
- accel
moving acceleration in degrees/secondē (default="1")
- speed
maximum moving speed in degrees/second (default="10")
- horizon
destination horizon ("off" or "-90" to "+90", default="0")
- tofov
destination field of view ("off" or "0" to "180", default="off")
example code:
<autorotate enabled="true"
waittime="1.0"
accel="1.5"
speed="10"
horizon="20"
tofov="150"
/>
<progress>
(optional)
show state of loading progress
attributes:
- showload
show loading progress function - "none" or "bar(...)", default="bar()"
bar syntax: (all parameters are optional)
bar(origin,width,height,offsetx,offsety,style,
backcolor,loadcolor,decodecolor,
bordercolor,borderwidth,glowcolor,glowwidth)
- origin = origin of progressbar: lefttop, leftmid, leftbottom, midtop, center, midbottom, righttop, rightmid, rightbottom; default=center
- width = width of progressbar in pixels (if you add a "%" to value its a percent value of the screenwidth), default="200"
- height = height of progressbar (height% = percent of screenheight), default="10"
- offsetx = x-distance from origin (offsetx% = percent of screenheight), default="0"
- offsety = y-distance from origin (offsety% = percent of screenheight), default="50"
- style = "solid" or "shaded", default="shaded"
- backcolor = background color of progressbar, default=0x000000
- loadcolor = color of loading progressbar, default=0xDDDDDD
- decodecolor = color of decoding progressbar, default=0xDDDDDD
- bordercolor = color of border, default=0x111111
- borderwidth = width of border, default=1
- glowcolor = color of glow, default=0xFFFFFF (=white)
- glowwidth = width of glow, default=8
- showwait
show waiting function - "none" or "loopings(...)", default="loopings()"
loopings syntax: (all parameters are optional)
loopings(color,points,size,bigpoint,smallpoint,
glowcolor,glowwidth,xpos,ypos)
- color = color of points, default=0xFFFFFF (=white)
- points = number of points, default=15
- size = radius of looping wheel, default=15 (=white)
- bigpoint = size of biggest point, default=0 (=automatic)
- smallpoint = size of smallest point, default=0 (=automatic)
- glowcolor = color of glow, default=0xFFFFFF (=white)
- glowwidth = width of glow, default=8
- xpos = position on screen (0..1), default=0.5 (=center)
- ypos = position on screen (0..1), default=0.5 (=center)
NOTE:
you can also use plugins to show the loading progress
- see
plugin documentation
example codes:
<progress showload="bar(center,33%,3%,0,15%,shaded,
0x000000,0x666666,0xAAAAAA)" />
<progress showload="none" showwait="loopings(0xFFFFFF)" />
<network>
(optional)
network settings for downloading and decoding images
attributes:
- downloadqueues
number of images the could be downloaded at the same time, default=1
- decodequeues
number of images the could be decoded at the same time, default=1
WARNING - don't use high values here, decoding costs much performance
example codes:
<network downloadqueues="2" />
<network downloadqueues="8" decodequeues="2" />
<memory>
(optional)
setting for memory usage
attributes:
- maxmem
maximum memory usage for the decoded image tiles in MB, default=350
interessting for large multiresolution images, if this limit is reached, not used tiles are freeed,
if they are reused then they must be decoding again,
example code:
<security>
(optional, Version 1.0.4 and higher)
Loads a cross-domain policy file from a location specified by the url parameter.
By default the Flash Player looks for the policy file located in root of a domain with the filename crossdomain.xml
on the server to which a data-loading request is being made.
With the crossdomain.url setting the Flash Player can load a policy file from a arbitrary locations.
For more Informations have a look at the Adobe site:
http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html
attributes:
- crossdomainxml.url
Path to the crossdomain.xml on the other server
- allowdomain.domain
Allow access to other domains (necessary for plugins that want access other domains).
You can also specify the special domain "*" to allow access from all domains.
Specifying "*" is the only way to allow access to nonlocal SWF files from local SWF files that have been published using Access Network Only for the Local Playback Security option in the Flash authoring tool.
example code:
<security>
<crossdomainxml url="http://..../crossdomain.xml" />
</security>
<security>
<allowdomain domain="maps.goolge.com" />
</security>
<textstyle>
(optional, Version 1.0.5 and higher)
with textstyle it's possible to define a own stylings for texts shown in the showtext() action.
the textstyle can be passed by name as second parameter
attributes:
- name
name of the textstyle, use DEFAULT to overwrite the default settings
- font
The name of the font.
- fontsize
The point size of the text.
- bold
Specifies whether the text is boldface, "true" or "false"
- italic
Indicates whether text is italicized, "true" or "false"
- background
Specifies whether the text field has a background fill, "true" or "false"
- backgroundcolor
The color of the text field background
- border
Specifies whether the text field has a border, "true" or "false"
- bordercolor
The color of the text field border
- textcolor
The color of the text in a text field
- alpha
alpha transparency value (0-1)
- blendmode
Flash blending mode
some modes: "normal", "add", "difference", "multiply", "screen" ...
default="normal"
look here for all available modes:
http://livedocs.adobe.com/.../BlendMode.html
and here for their working:
http://livedocs.adobe.com/.../DisplayObject.html#blendMode
- effect
bitmap effects, can be any combination of this effect functions:
- glow(color,alpha,range,strength);
- dropshadow(depth,angle,color,range,strength);
- blur(radius);
- origin (Version 1.0.6 and higher)
"cursor" - set textposition to mouse cursor (=default)
for a fixed positon on screen use one of these values:
"lefttop", "left", "leftbottom", "top", "center", "bottom", "righttop", "right", "rightbottom"
- edge (Version 1.0.6 and higher)
edge/origin positon on the text itself, default="bottom"
- textalign (Version 1.0.6 and higher)
align of the text: "none", "left", "center", "right" (default="none")
- xoffset (Version 1.0.6 and higher)
x offset of text (default="0")
- yoffset (Version 1.0.6 and higher)
y offset of text (default="-3")
- noclip (Version 1.0.6 and higher)
avoid clipping of text on screen borders (default="true")
- showtime (Version 1.0.6 and higher)
time to the show the text in seconds (default="0,1")
notes:
- when loading a other xml file, all textstyle tags remain unchanged unless they are defined again in the other xml.
then they will be overwritten with the new ones.
example code - DEFAULT style:
<textstyle name="DEFAULT"
font="Times"
fontsize="12"
bold="true"
italic="false"
background="false"
backgroundcolor="0xFFFFFF"
border="true"
bordercolor="0x000000"
textcolor="0x000000"
alpha="1.0"
blendmode="normal"
effect=""
/>
example code - own style:
<textstyle name="NEWSTYLE"
font="Arial" fontsize="10"
border="false" background="false"
textcolor="0xFFFFFF"
effect="glow(0x000000,0.7,4,2);
dropshadow(2,45,0x000000,3,1);"
/>
example code - showtext() with second parameter
... onhover="showtext(Text with textstyle,NEWSTYLE);" ...
DEMO:
view some textstyles interactive
<hotspot>
(optional)
Hotspots are areas in the panorama, which react on mouse hovering or clicking.
They can be used to load other panoramas, links to other urls, change the viewing and so on...
Child nodes:
<hotspot attributes>
<point attributes />
<point attributes />
<point attributes />
...
</hotspot>
hotspot attributes:
- name
name of the hotspot (only for intern use, must be unique)
- handcursor (Version 1.0.5 and higher)
show handcursor when mouse is over, "true" or "false", default="true"
- fillcolor
filling color for the hotspot (color in hexadecimal in form of 0xFFFFFF), default="0xFFFFFF"
- fillcolorhover
filling color for the hotspot when mouse hovers the area, default="0xFFFFFF"
- fillalpha
alpha value (transparency) for the hotspot (0-1), default="0.0"
- fillalphahover
alpha value for the hotspot when mouse hovers the area (0-1), default="0.1"
- borderwidth
linewidth of the border in pixels, default="0"
- borderwidthhover
linewidth of the border when mouse hovers the area, default="4"
- bordercolor
color for the border, default="0xFFFFFF"
- bordercolorhover
color for the border when mouse hovers the area, default="0xFFFFFF"
- borderalpha
alpha value for the border (0-1), default="0.0"
- borderalphahover
alpha value for the border when mouse hovers the area (0-1), default="0.8"
- fadeintime
time to fade from normal to hover state in seconds, default="0.15"
- fadeouttime
time to fade from hover to normal state in seconds, default="0.30"
- fadeincurve
linear or nonlinear in-fading when hovering:
1.0=linear fading, < 1.0=slower fading, > 1.0 = faster fading, default="1.1"
- fadeoutcurve
linear or nonlinear out-fading when mouse moved from area
1.0=linear fading, < 1.0=slower fading, > 1.0 = faster fading, default="0.7"
- onover (Version 1.0.6 and higher)
action that will start when mouse comes overs the hotspot area, default=""
- onhover
action that will called in intervals when mouse stays overs the hotspot area, default=""
- onout (Version 1.0.6 and higher)
action that will start when mouse leaves the hotspot area, default=""
- onclick
action that will start mouse clicks into the hotspot area, default=""
point attributes:
- ath
point at horizontal position in spherical coordinates (0 .. 360°)
- atv
point at vertical position in spherical coordinates (-90 .. +90°)
example code:
<hotspot name="nextpano"
onhover="showtext(load next pano)"
onclick="loadpano(nextpano.xml)" >
<point ath="160" atv="-20" />
<point ath="200" atv="-20" />
<point ath="200" atv="+20" />
<point ath="160" atv="+20" />
</hotspot>
<lensflareset>
(optional)
create a lensflare set, settings how the flares are looking
there is one base image for the flares.
the flares will be defined as pice of the base image, but they could have a
other color and size
Child nodes:
<lensflareset attributes>
<flare attributes />
<flare attributes />
<flare attributes />
...
</lensflareset>
attributes for lensflareset:
- name
name of the lensflareset, this name can be used by a lensflare set="..."
- url
path to the image with the flares
attributes for flare:
- pixsize
pixel size of the area of a flare, the area must be quadratic, so only value must be set
- pixupos
horizontal pixel position of flare area
- pixvpos
vertical pixel position of flare area
- color
color of the flare (hexadecimal in form of 0xFFFFFF), will be blended with the image colors
"0xFFFFFF" for no change of the original pixels
- pos
position of the flare on the screen:
0.0 = at the start point (at the ath,atv position of a lensflare)
1.0 = opposite position from start point
can be from -2.0 to +5.0
- scale
size in relation to screen height, typical values are from 0.01 to 0.10
example codes:
<lensflareset name="USER1" url="flare2.jpg">
<flare pixsize="128" pixupos="0" pixvpos="0"
color="0x967864" pos="+0.00" scale="0.130" />
<flare pixsize="128" pixupos="256" pixvpos="0"
color="0x200A05" pos="-0.40" scale="0.100" />
<flare pixsize="128" pixupos="128" pixvpos="0"
color="0x967878" pos="+0.30" scale="0.100" />
<flare pixsize="128" pixupos="256" pixvpos="0"
color="0x2B2D14" pos="+0.60" scale="0.092" />
<flare pixsize="128" pixupos="128" pixvpos="0"
color="0x46140A" pos="+0.40" scale="0.050" />
<flare pixsize="64" pixupos="512" pixvpos="0"
color="0x142800" pos="+0.25" scale="0.018" />
<flare pixsize="128" pixupos="384" pixvpos="0"
color="0x211E19" pos="+2.30" scale="0.300" />
<flare pixsize="64" pixupos="512" pixvpos="0"
color="0x280F00" pos="+1.20" scale="0.050" />
<flare pixsize="64" pixupos="512" pixvpos="0"
color="0x212400" pos="+1.70" scale="0.045" />
<flare pixsize="128" pixupos="128" pixvpos="0"
color="0x0F1E4B" pos="+2.30" scale="0.030" />
<flare pixsize="128" pixupos="128" pixvpos="0"
color="0x002850" pos="+3.40" scale="0.020" />
</lensflareset>
<lensflare>
(optional)
sets up a sun lensflare effect
attributes:
- set
lensflareset, must be defined before, default="DEFAULT"
("DEFAULT" is a predefined lensflareset)
- ath
sun at horizontal position in spherical coordinates (0 .. 360°)
- atv
sun at vertical position in spherical coordinates (-90 .. +90°)
- size
size of flares, default="0.8"
- blind
blind factor, how much will it blind when you look into the sun:
0=nothing, 1=full blending, default="0.6"
- blindcurve
blinding curve, (1-10), 1=linear, default="4"
example codes:
<lensflare set="DEFAULT"
ath="140.3057"
atv="-20.6741"
size="0.80"
blind="0.60"
blindcurve="6.00"
/>
<lensflare set="MYLENSFLARESET"
ath="20.0"
atv="-45.0"
/>
<plugin>
(optional)
with "plugin" you can include extern images or flash applications/movies
attributes:
- name
name of plugin (only for intern use, must be unique)
- url
path to image or swf
- visible
"true" or "false", default="true"
- enabled (Version 1.0.6 and higher)
"true" or "false", default="true"
- children (Version 1.0.6 and higher)
send mouse events also to childrens (needed for some flash plugins)
"true" or "false", default="true"
- handcursor (Version 1.0.5 and higher)
show handcursor when mouse is over, "true" or "false", default="true"
- zorder (Version 1.0.2 and higher)
order of the plugins, 0-n, default=""
- alpha
alpha blend factor (0-1), default="1.0"
- blendmode
Flash blending mode
some modes: "normal", "add", "difference", "multiply", "screen" ...
default="normal"
look here for all available modes:
http://livedocs.adobe.com/.../BlendMode.html
and here for their working:
http://livedocs.adobe.com/.../DisplayObject.html#blendMode
- autopos
automatic postion, syntax: "origin,xoffset,yoffset" or "false"
- autoscale
automatic scaling, syntax: "xscale,yscale" or "false"
- origin (Version 1.0.5 and higher)
origin positon on the screen:
lefttop,left,leftbottom,top,center,bottom,righttop,right,rightbottom
- edge (Version 1.0.5 and higher)
edge/origin positon on the plugin itself - default is same value as "origin"
- x (Version 1.0.5 and higher)
distance from the origin screen position to the edge postion
- y (Version 1.0.5 and higher)
distance from the origin screen position to the edge postion
- width (Version 1.0.5 and higher)
width of the plugin in pixel or percents
- height (Version 1.0.5 and higher)
height of the plugin in pixel or percents
- onover (Version 1.0.5 and higher)
action that will start when mouse comes overs the plugin/image, default=""
- onhover
action that will called in intervals when mouse stays overs the plugin/image, default=""
- onout (Version 1.0.2 and higher)
action that will start when mouse leaves the plugin/image, default=""
- onclick
action that will start when mouse clicks on plugin/image, default=""
- ondown (Version 1.0.1 and higher)
action that will start when mouse button down on plugin/image, default=""
- onup (Version 1.0.1 and higher)
action that will start when mouse button up, default=""
- changeorigin (only callable! Version 1.0.6 and higher)
this is predefined function of the plugin node, it can't be set or overwritten.
- customattributes (only for flash plugins! Version 1.0.6 and higher)
if a plugin has user defined attributes, they should be listed here.
a plugin should fill this attribute by it's own.
example codes:
<plugin name="logo"
url="krpano_logo.png"
alpha="1.0"
blendmode="normal"
autopos="rightbottom,1%,1%"
autoscale="false"
onhover="showtext(visit krpano.com);"
onclick="openurl(http://krpano.com,_blank);"
/>
<plugin name="options" url="plugins/options.swf" />
<plugin name="editor" url="plugins/editor.swf" />
<include>
(optional)
include other xml files (can be used more than once)
this can be used to split up the images and settings.
the include tag will be replace with the contents of the included xml file.
attributes:
- url
path of the xml file to include
example codes:
<include url="settings.xml" />
<include url="plugins.xml" />
<include url="lensflaresets.xml" />
<include url="../samesettingsforallpanos.xml" />
<data>
(optional, Version 1.0.6 and higher)
a named data section, can be used to store informations.
access to content via "get(data[name]);"
attribute:
notes:
- when loading a other xml file, all data tags remain unchanged unless they are defined again in the other xml.
then they will be overwritten with the new ones.
example code - store html and css code for the textstyle plugin
<data name="cssdata">
a { color:#0000FF; }
a:hover { color:#FF0000; }
</data>
<data name="htmldata">
<b>Hello from Flash HTML</b><br/>
<a href="event:set(plugin[txt].visible,false);">
close this window
</a>
</data>
<plugin name="txt" url="textfield.swf"
html="htmldata"
css="cssdata"
/>