Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.
Quoted from "s-maier"
However I notice some big diffrence: The Scrollarea even displays the scrollbars when there is nothing to scroll.
This is very counter intuitive and kinda annoying.
I assume you mean the new autoscrollbars feature - that's only for automatic controlling and sizing the scrollbars, but they will not change the layout of the scrollarea or other layers.
For checking if scrollbars are required, the onoverflowchange event and the woverflow / hoverflow variables can be used. When the values are greater than 0, then the content is overflowing and a scrollbar would be required.
Source code
1
onoverflowchange="if(hoverflow GT 0, show the scrollbar, adjust the layout..., hide the scrollbar... );"
in 1.21 the string '*' as action parameter is passed as null.
Zitat
New: Instead of get(var) it is now also possible to use just *var to resolve a variable to its value. Can be used when passing a variable to an action or as an array index.
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<events name="bg_scale_map" onresize="bg_automatic_fit_inside(map);" />
<action name="bg_automatic_fit_inside">
if(layer[%1].loaded,
div(screenaspect, stagewidth, stageheight);
div(imageaspect, layer[%1].imagewidth, layer[%1].imageheight);
if(imageaspect GT screenaspect,
if (device.mobile,
set(layer[%1].width,90%);
set(layer[%1].height,prop);
,
set(layer[%1].width,80%);
set(layer[%1].height,prop);
);
,
if (device.mobile,
set(layer[%1].width,prop); set(layer[%1].height,90%);
,
set(layer[%1].width,prop); set(layer[%1].height,80%);
);
);
);
</action>
|
Right, its the same as here - size and scale are decoupled now...I have a feeling that it happens because of the decorrelation of the scale and layer dimensions but I didn't find a solution to make this worked correctly.
|
|
Quellcode |
1 2 3 4 5 6 7 |
<action name="bg_automatic_fit_inside">
callwith(layer[%1],
if(loaded,
scale = 0.9 * min(stagewidth/sourcewidth, stageheight/sourceheight);
);
);
</action>
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »jeromebg« (24. Februar 2023, 11:36)
|
|
Quellcode |
1 2 3 |
<action name="change_scene" scope="localonly" args="new_scene">
loadscene(get(new_scene));
</action>
|
|
|
Quellcode |
1 2 3 |
<action name="change_scene" scope="local" args="new_scene">
loadscene(get(new_scene));
</action>
|
Zitat
Fix: When a loadpano/scene/xml action was called from a localscope action, the xml parsing could wrongly write some parsing results into the localscope.
I noticed a strange behavior when calling "loadscene" inside an action with its scope argument set to "localonly". This action code will only load the preview image of the new scene (plus its hotspots etc., but the pano will stay blurry):
Sorry, I can't reproduce this...
Do you use version 1.21?
|
|
Quellcode |
1 |
krpano.call('change_scene_localonly("scene1");');
|
|
|
Quellcode |
1 |
krpano.call('change_scene_local("scene1");');
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<scene name="scene1" title="scene1" onstart="" havevrimage.mobilevr="false" havevrimage.no-mobilevr="true" thumburl="panos/scene1.tiles/thumb.jpg" lat="" lng="" alt="" heading=""> <control bouncinglimits="calc:image.cube ? true : false" /> <view hlookat="0.0" vlookat="0.0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" /> <preview url="panos/scene1.tiles/preview.jpg" /> <image type="CUBE" multires="true" tilesize="512" if="!webvr.isenabled"> <level tiledimagewidth="4224" tiledimageheight="4224"> <cube url="panos/scene1.tiles/%s/l3/%0v/l3_%s_%0v_%0h.jpg" /> </level> <level tiledimagewidth="2112" tiledimageheight="2112"> <cube url="panos/scene1.tiles/%s/l2/%0v/l2_%s_%0v_%0h.jpg" /> </level> <level tiledimagewidth="1024" tiledimageheight="1024"> <cube url="panos/scene1.tiles/%s/l1/%0v/l1_%s_%0v_%0h.jpg" /> </level> </image> </scene> |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<scene name="scene2" title="scene2" onstart="" havevrimage.mobilevr="false" havevrimage.no-mobilevr="true" thumburl="panos/scene2.tiles/thumb.jpg" lat="" lng="" alt="" heading=""> <control bouncinglimits="calc:image.cube ? true : false" /> <view hlookat="0.0" vlookat="0.0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" /> <preview url="panos/scene2.tiles/preview.jpg" /> <image if="!(webvr.isenabled OR device.mobilevr)"> <cube url="panos/scene2.tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,1024,2112,4224" /> </image> <image if="webvr.isenabled OR device.mobilevr"> <cube url="panos/scene2.tiles/vr/pano_%s.jpg" /> </image> </scene> |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »ctt360« (1. März 2023, 10:52)
So I guess this has something to do with backwards compatibility. Not sure, what your policy is in this case, as krpano 1.21 is expected to break some things anyway and we might need to simply regenerate all scenes when upgrading older projects.

Please post your example (in a separate thread).Question about scrollarea
there was/is the (textfield) onautosized event which is called when the layer gets its size.
but it is missing now in the 1.21 documentation...
@klaus: how do we do that in 1.21?
Klaus mentioned here that from version 1.21 it will be possible to assign any actions and events to the right mouse button.
I can’t figure out how to attach an action to the right mouse button press event, for example,
zooming by a certain amount when pressed and zoomingout when the right mouse button is released.
Has anyone already figured this out?
|
|
Quellcode |
1 2 3 4 5 6 7 8 |
<events ondown="copy(orgfov, view.fov);
asyncloop(mouse.rightbutton,
mousemovey = calc(mouse.downy - mouse.y);
set(newfov, calc(orgfov-calc(roundval(mousemovey/10, 2))));
set(view.fov, get(newfov));
);" />
<events onup="if (mouse.button==2, tween(view.fov, get(orgfov), 0.2);)" />
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »kme« (25. Februar 2023, 10:50)
|
|
Quellcode |
1 2 3 |
<events ondown="if (mouse.button==2, copy(orgfov, view.fov); tween(view.fov, get(calc(orgfov-30)), 0.2);)" /> <events onup="if (mouse.button==2, tween(view.fov, get(orgfov), 0.2);)" /> |
Brilliant my friend! Thank you very much for the hint, for this piece of code,I also tried the following code:
![]()
Quellcode
1
But in this case, the krpano menu still pops up if you don't move the mouse (which I think is intentional and cannot be disabled).
|
|
Quellcode |
1 2 3 |
<events ondown="if (mouse.button==2, copy(orgfov, view.fov); tween(view.fov, get(calc(orgfov-30)), 0.2);)" /> <events onup="if (mouse.button==2, tween(view.fov, get(orgfov), 0.2);)" /> |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »kme« (26. Februar 2023, 11:33)