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 information about the basic XML syntax look here:
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
it is also possible to use these placeholders to specify the full path:
%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
Description of all nodes - krpano version 1.0.7
<krpano>
the root node of a krpano xml file
attributes:
version
krpano version used when creating the xml file, NOTE - this version number is used to be downward compatible,
that's important for older plugins or javascript interface examples
- versions lower or equal then 1.0.5 have a "string"-based get/set interface
- versions higher then 1.0.5 have a "type-correct" get/set interface
onstart
action that will performed at the start of the viewing.
basedir
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%, that means the paths of all all following loaded XML files by the loadpano() action are
relative to the first loaded XML file.
VERSION NOTES / UPDATE NOTES:
the behavior of version older than 1.0.6 can be restored by setting
"basedir" to %CURRENTXML%
logkey
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
actionintervalbase
base of interval actions: (for movments like lookto,tween,...)
"timer"
movement based on time
constant time interval (as good as possible)
the number for frames for the movement depends on the power of the computer (when reloading also on the internet connection)
(more frames and smoother moving on faster computers and less frames and maybe jerky moving on slower ones)
"frame"
movement based on frame
always the same number of frames are used for a movement
the time of the movement depends on the power of the computer
(short time on faster computers and longer time on slower ones, but always smooth)
when doing scripted "zooms" in multiresolution panoramas this helps to keep the movment smooth
when tiles are reloaded
example code - start with a move to 45,2 and fov 120:
The Panorama Image
- set the type of the panorama image
- the paths to the image files
- when tiled or multiresolutions - the tilesize and the size of image
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
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 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.
Panorama image that will be displayed while loading. Should be small!
- the image should be not too low res (to avoid big pixels)
- but it should very smooth for good jpeg compression
- filesize should be small!
- sphere or cubestrip images are possiblie
- or alternatively you can display a custom colored 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="LFRBUD")
details
rendering details (4-32), more details are more exact 3d-geometry, default=8
high quality preview images can be easily created with the kmakepreview tool
<action>
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:
name
name of the action
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
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.
fps
framerate in frames per second, should be something between 30 and 100, default=60
details
- rendering details (1-n)
- more details is more exact 3d-geometry
- higher values will reduce "wave-distortions-effects" but also the performance
- default=16
tessmode
tesslation mode, 1-5 or "-1" (=automatic)
default="-1" => 0 for spheres and 3 for cubes
movequality
quality while moving - LOW or HIGH or HIGHSHARP, default=LOW
stillquality
quality while not moving - LOW or HIGH or HIGHSHARP, default=HIGH
NEW - HIGHSHARP - after rendering the pano in HIGH quality it will be additionally postprocess with a 1 pixel
unsharp-mask filter, this setting needs a lot of processing power so it should be only used for stillquality.
stilltime
time in seconds after swtiching from "movequality" to "stillquality", default=0.25
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=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
stereographic - NEW
stereographic fisheye projection (true or false, default=false) this is switch between normal fisheye and stereographic view,
it allowes interessting panorama views like Little Planet Views
architectural
architectural projection, (0 - 1), default="0.0" (=disabled)
set to "1.0" to enable architectural projection mode
architecturalonlymiddle
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
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
horizontal minimum look position in spherical coordinates (-180° .. +180°), default="-180"
(if (hlookatmax-hlookatmin) is 360 then there is no limiting)
hlookatmax
horizontal maximum look position in spherical coordinates (-180° .. +180°), default="+180"
(if (hlookatmax-hlookatmin) is 360 then there is no limiting)
vlookatmin
vertical minimum look position in spherical coordinates (-90° .. +90°), default="-90"
vlookatmax
vertical maximum look position in spherical coordinates (-90° .. +90°), default="+90"
<plugin> can be used to include other flash applications to just simple images,
e.g. buttons, images, logos...
attributes:
name
name of the plugin, needed for identification / access to it
url
path to the image or swf file
visible
true or false, default=true
enabled
is plugin enabled to receive mouse events (true or false, default=true)
NEW in Version 1.0.7:
when false then mouse events are routed to underlying objects
capture
a addtional setting to "enabled":
- when "enabled=true" and "capture=true" then mouse events are only sent to this plugin
- when "enabled=true" and "capture=false" then the mouse events are sent to the plugin and also to all underlying objects
(true or false, default=true)
children
send mouse events also to children objects of the plugin (needed for some flash plugins)
true or false, default=true
handcursor
show handcursor when mouse is over (true or false, default=true)
keep (NEW - Version 1.0.7 and higher)
important flag for virtual tour or conntect panoramas!
possibly values: true or false, default=false
when keep is set to true the plugin/hotspot is kept when loading other panoramas,
otherwise it will be removed
zorder
order of the plugins, 0-n, default=""
alpha
alpha blend factor (0-1), default="1.0"
NOTE - when alpha is set to "0" the plugin is invisible, but it still receives mouse events, and it also
is drawn by the flashplayer.
to hide a plugin completely, set "visible" to false
autopos (decrepated)
automatic postion, syntax: "origin,xoffset,yoffset" or "false"
autoscale (decrepated)
automatic scaling, syntax: "xscale,yscale" or "false"
align
origin positon on the screen:
lefttop,left,leftbottom,top,center,bottom,righttop,right,rightbottom
NOTE - this is the same like the "origin" attribute, just another/better name
origin (decrepated)
origin positon on the screen:
lefttop,left,leftbottom,top,center,bottom,righttop,right,rightbottom
edge
edge/origin positon on the plugin itself - default is same value as "origin"
x
distance from the origin screen position to the edge postion
can a absolute pixel value or a relative to screenwidth percent value
y
distance from the origin screen position to the edge postion
can a absolute pixel value or a relative to screenheight percent value
width
width of the plugin in absolute pixels or percents of the screenwidth
set it to "prop" to allow scaling the width proportional to the height
if nothing is set, the width of the source file will be set
height
height of the plugin in absolute pixels or percents of the screenheight
set it to "prop" to allow scaling the height proportional to the width
if nothing is set, the height of the source file will be set
scale
scaling of the plugin, default="1.0"
Illustration of the relation of "align", "edge", "x", "y", "width", "height" and scale:
smoothing
pixel smoothing when resizing (by changing width / height or scale)
(true or false, default=true)
onover
action that will be called when mouse comes overs the plugin/image
onhover
action that will called in intervals when mouse stays/hovers over the plugin/image
onout
action that will be called when mouse leaves the plugin/image
onclick
action that will be called when mouse clicks on plugin/image
ondown
action that will be called when mouse button is down on plugin/image
onup
action that will be called on mouse button up
onloaded
action that will be called when loading of the plugin is done
changeorigin(neworigin,newedge) (function)
this a function to change the alignment / origin of a plugin without changing the current
position (that means it recalculates the "x" and "y" values to keep the current position but with other offsets).
syntax:
plugin[name].changeorigin(neworigin,newedge);
resetsize() (function)
sets the "width" and "height" attribute to original size of the source image
can be used for dynamic "url" changing to get the size of the new loaded image!
syntax:
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 ...
There are currently 2 types of Hotspots:
Polygonal Hotspots
these are areas which are defined by a set of points
Image Hotspots
these are images or flash movies as hotspots
The type of the hotspots is defined by their attributes:
- if the "url" attribute is set it is a image hotspot
- if not and there are points defined it is a polygonal hotspot
common attributes for polygonal and image hotspots:
name
name of the hotspot, needed for identification / access to it
visible
true or false, default=true
enabled
is hotspot enabled to receive mouse events (true or false, default=true)
new in Version 1.0.7:
when false then mouse events are routed to underlying objects
capture
a addtional setting to "enabled":
- when "enabled=true" and "capture=true" then mouse events are only sent to this hotspot
- when "enabled=true" and "capture=false" then the mouse events are sent to the hotspot and also to all underlying objects
(true or false, default=true)
children
send mouse events also to children objects of the plugin (needed for some flash plugins)
true or false, default=true
handcursor
show handcursor when mouse is over (true or false, default=true)
keep (NEW - Version 1.0.7 and higher)
important flag for virtual tour or conntect panoramas!
possibly values: true or false, default=false
when keep is set to true the plugin/hotspot is kept when loading other panoramas,
otherwise it will be removed
zorder
order of the hotspots, 0-n, default=""
alpha
alpha blend factor (0-1), default="1.0"
NOTE - when alpha is set to "0" the plugin is invisible, but it still receives mouse events, and it also
is drawn by the flashplayer.
to hide a plugin completely, set "visible" to false
usercontrol
allowed control modes: "all" or "keyb" or "mouse" or "off" - 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
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)
- 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 captions:
- use "KRPANO" to place the "About krpano..." item there
- if no "KRPANO" item was defined it will be added at the end
- use "FULLSCREEN" to place the "Fullscreen" / "Exit Fullscreen" item there
- if no "FULLSCREEN" 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
network settings for downloading and decoding images
attributes:
downloadqueues
number of images that could be downloaded at the same time, default=2
decodequeues
number of images the could be decoded at the same time, default=2
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:
<memory maxmem="500" />
<security>
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 Information 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.
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
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
"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
edge/origin positon on the text itself, default="bottom"
textalign
align of the text: "none", "left", "center", "right" (default="none")
xoffset
x offset of text (default="0")
yoffset
y offset of text (default="-3")
noclip
avoid clipping of text on screen borders (default=true)
showtime
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.
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
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
name
name of the lensflare, needed for identification / access to it
keep
important flag for virtual tour or conntect panoramas!
possibly values: true or false, default=false
when keep is set to true the lensflare is kept when loading other panoramas,
otherwise it will be removed
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"
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.
a named data section, can be used to store information.
access to content via "get(data[name].content);"
attribute:
name
name of the data
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"
/>