Great !! Thanx Zephyr for your input!! interesting code!
i see something!
this is what happens with this exact code
http://www.virtualtuur.com/krpano/simple/4/
let's play a bit..
..
http://www.virtualtuur.com/krpano/simple/5/
http://www.virtualtuur.com/krpano/simple/5/gallery5.xml
with a thumb stage so i can move the whole..
or can i do that also in the build thumbs?
I tried to set an x but then that's no option i think..
so what happens.. u see it also in example 4.. the Zephyr code
- all the pics have the title of the last one in the <pic> 'storage'..
- only the last one responds to onout/onover
Code
<pic>
<thumb name="thumb_0" url="../images/001.jpg" title="Test" todo="" />
<thumb name="thumb_1" url="../images/002.jpg" title="Test" todo="" />
<thumb name="thumb_2" url="../images/003.jpg" title="Test" todo="" />
<thumb name="thumb_3" url="../images/004.jpg" title="another test" todo="" />
<thumb name="thumb_4" url="../images/005.jpg" title="Test" todo="" />
<thumb name="thumb_5" url="../images/006.jpg" title="Test" todo="" />
<thumb name="thumb_6" url="../images/007.jpg" title="Test" todo="" />
<thumb name="thumb_7" url="../images/008.jpg" title="Test" todo="" />
<thumb name="thumb_8" url="../images/009.jpg" title="keep testing" todo="lookat(140,0,50);" />
</pic>
<action name="build_thumbs">
trace(pic.thumb.count); <!-- Traces 1, because there is 1 thumb in pic -->
set(columns, 3); <!-- Max columns, change to make it longer -->
if(%1 != NEXT, set(i,0)); <!-- if the first parameter isn't next, then set the counter to 0 -->
txtadd(tn, 'thumb_', get(i)); <!-- puts thumb_ and i together so you get thumb_1, thumb_2 etc -->
addplugin(get(tn)); <!-- creates a plugin called thumb_1 (same name as thumb) -->
set(plugin[get(tn)].url, get(pic.thumb[get(tn)].url)); <!-- sets the url of the plugin the same as thumb url -->
set(plugin[get(tn)].onhover, showtext(get(pic.thumb[get(tn)].title))); <!-- sets the tooltipof the plugin the same as thumb title-->
set(plugin[get(tn)].parent, thumb_stage);
set(plugin[get(tn)].alpha, 0.8);
set(plugin[get(tn)].align, center);
set(plugin[get(tn)].height,60);
set(plugin[get(tn)].width,60);
set(plugin[get(tn)].effect,glow(0xFFFFFF,20.0,6,10000));
set(plugin[get(tn)].onover,set(plugin[get(tn)].alpha, 1.0));
set(plugin[get(tn)].onout,set(plugin[get(tn)].alpha, 0.8));
set(plugin[get(tn)].onclick,get(pic.thumb[get(tn)].todo));
mod(tmp_mod, get(i), get(columns)); <!-- using i % columns, I can calculate which collumn tbe thumb should be -->
mul(x_offset, get(tmp_mod), 80); <!-- picture height * outpu from prev calculation -->
div(tmp_div, get(i), get(columns)); <!-- same trick for rows -->
js(floor(get(tmp_div))); <!-- need to use Math.floor in javascript since krpano doesnt support it -->
mul(y_offset, get(floor), 80); <!-- floor is the var set by js -->
set(plugin[get(tn)].x, get(x_offset));
set(plugin[get(tn)].y, get(y_offset));
inc(i); <!-- increase i by 1 -->
if(i LT pic.thumb.count, build_thumbs(NEXT));
</action>
Display More
Tuur
ps
I would love to stay in xml actualy .. so when there is a way ?
or do we really need a floor?