Hi Klaus,
I got strange results in trying to set custom settings for the area.
I try to set the area.x to 50% and the area.with to half of stagewidth (the rest of the stage width)...
Like this:
But, in this code, the resulting area is not as I expect:
<krpano version="1.0.8" onstart="showlog(); area_settings();" >
<view fov="120" fovtype="DFOV" />
<preview type="grid(cube, 20, 20, 200, 0xCCCCCC, 0xFFFFFF, 0x000000)" details="12" />
<events onresize="trace_area(from_onresize);" />
<action name="area_settings">
trace('-- call to area_settings() --');
set(area.x,50%);
sub(area.width,stagewidth,area.pixelx);
trace_area(from_area_settings);
</action>
<action name="trace_area">
trace('-- trace_area %1 --');
trace('area.x = ',area.x);
trace('area.pixelx = ',area.pixelx);
trace('area.width = ',area.width);
trace('area.pixelwidth = ',area.pixelwidth);
trace('stagewidth = ',stagewidth);
</action>
</krpano>
Alles anzeigen
with this code, the area is displayed correctly beginning at the middle of the screen but the width is displayed only half (the other half it is out of the screen).
The resulting trace are:
ZitatAlles anzeigenINFO: krpano 1.0.8.11 (build 2010-05-31)
INFO: Flashplayer WIN 10,1,53,64 PlugIn
WARNING: not local trusted - ExternalInterface disabled!
INFO: -- call to area_settings() --
INFO: -- trace_area from_area_settings --
INFO: area.x = 50%
INFO: area.pixelx = 0
INFO: area.width = 1024
INFO: area.pixelwidth = 1024
INFO: stagewidth = 1024
INFO: -- trace_area from_onresize --
INFO: area.x = 50%
INFO: area.pixelx = 512
INFO: area.width = 1024
INFO: area.pixelwidth = 1024
INFO: stagewidth = 1024
Adding in line 12 a wait(0); inside the action that sets the area:
<krpano version="1.0.8" onstart="showlog(); area_settings();" >
<view fov="120" fovtype="DFOV" />
<preview type="grid(cube, 20, 20, 200, 0xCCCCCC, 0xFFFFFF, 0x000000)" details="12" />
<events onresize="trace_area(from_onresize);" />
<action name="area_settings">
trace('-- call to area_settings() --');
set(area.x,50%);
wait(0);
sub(area.width,stagewidth,area.pixelx);
trace_area(from_area_settings);
</action>
<action name="trace_area">
trace('-- trace_area %1 --');
trace('area.x = ',area.x);
trace('area.pixelx = ',area.pixelx);
trace('area.width = ',area.width);
trace('area.pixelwidth = ',area.pixelwidth);
trace('stagewidth = ',stagewidth);
</action>
</krpano>
Alles anzeigen
Using this wait(0); the area displays correctly beginning at the middle of the screen and the width is egal to half of the stagewidth as expected.
And the resulting trace are:
ZitatAlles anzeigenINFO: krpano 1.0.8.11 (build 2010-05-31)
INFO: Flashplayer WIN 10,1,53,64 PlugIn
WARNING: not local trusted - ExternalInterface disabled!
INFO: -- call to area_settings() --
INFO: -- trace_area from_area_settings --
INFO: area.x = 50%
INFO: area.pixelx = 512
INFO: area.width = 512
INFO: area.pixelwidth = 1024
INFO: stagewidth = 1024
INFO: -- trace_area from_onresize --
INFO: area.x = 50%
INFO: area.pixelx = 512
INFO: area.width = 512
INFO: area.pixelwidth = 1024
INFO: stagewidth = 1024
INFO: -- trace_area from_onresize --
INFO: area.x = 50%
INFO: area.pixelx = 512
INFO: area.width = 512
INFO: area.pixelwidth = 512
INFO: stagewidth = 1024
only at the end of the trace, the area variables are as expected...
I am doing something wrong
SAlut.