• Oh brilliant, I didn't see the "onoverflowchange" and worked on a much more complicated solution. Thanks!

  • Hello Klaus,

    in 1.21 the string '*' as action parameter is passed as null.

    Code
    <action name="test" scope="local" args="arg1">
       trace(%1, " - ", get(arg1));
    </action>
    test('*');

    results in "INFO: null - null"

    Not a great problem, but one has to know it.

    Wolfgang

  • Hi,

    in 1.21 the string '*' as action parameter is passed as null.


    That's due the new *var syntax support for resolving the variable content:

    Quote

    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.


    Additionally: 'historically' the string quotes were resolved 'before' doing the get/calc/*/() resolving , so the quotes weren't bypassing that parsing step. For the next release I have tried now moving the string-quote resolving 'after' the get/calc resolving. This should solve this problem and would be generally a better behavior, but I will need to check for potential compatibility problems with this change.

    Best regards,
    Klaus

  • Hi Klaus,
    I have an issue with the resizing of layer and its children.
    With previous version I used this code (that, if I remember well, you provided) :

    With version 1.21, the layer is resizing well but the children layers have a position shift(I tried this code in the example of winecellar, when resizing there are the position of the three mapspots is shifting).

    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.
    If anyone has a clue I'm interested !
    Thanks !
    Tristan

  • Hi,

    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.

    Right, its the same as here - size and scale are decoupled now...

    Here an alternative solution:

    Code
    <action name="bg_automatic_fit_inside">         
      callwith(layer[%1],
        if(loaded,
          scale = 0.9 * min(stagewidth/sourcewidth, stageheight/sourceheight);
        );
      );
    </action>

    The 0.9 maps to the 90% in the old example - so the image covers max. 90% of the width or height depending on the screen and image aspect. It's even simpler because no "prop" would need to be used. And an animation by tweening the scale would be possible...

    Best regards,
    Klaus

  • Hi,
    I have a issue with the combobox 1.21
    The text item is offset depending on item position in the list : https://360images.fr/barebone_combobox_1.21/combobox.webm
    You can test it here : https://360images.fr/barebone_combobox_1.21/
    I have no issue when testing with 1.20.11
    I have a tour with 40 items in the list and it can scroll between 2 items instead of scrolling to the clicked item ?
    A clue ?

    Edited once, last by jeromebg (February 24, 2023 at 11:36 AM).

  • Hi Klaus,

    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):

    Code
    <action name="change_scene" scope="localonly" args="new_scene">
        loadscene(get(new_scene));
    </action>

    When I change the actions scope to "local" the full pano image gets loaded as expected:

    Code
    <action name="change_scene" scope="local" args="new_scene">
        loadscene(get(new_scene));
    </action>

    My guess would be that the "loadscene" action inherits the scope from my action, but doesn't use the global object to access certain variables and fails silently. This might be related to this change from the release notes:

    Quote

    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.

    Is this behavior intentional?

    Kind regards
    Christian


  • Sorry, I can't reproduce this...
    Do you use version 1.21?

    Hi Klaus,

    yes, I use version 1.21. After some more testing I have now isolated a test case, please see [redacted] (view-source:[redacted])

    Executing this command via the console will only display the blurry preview image:

    Code
    krpano.call('change_scene_localonly("scene1");');

    This command works as expected:

    Code
    krpano.call('change_scene_local("scene1");');

    "scene1" is from an older project that I tried to upgrade to krpano 1.21 and it looks like this:

    I also added a "scene2" to the test case that works as expected with both actions ("local" and "localonly"). This is a newly created scene using the krpano tools 1.21.:

    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.

    Kind regards
    Christian

    Edited once, last by ctt360 (March 1, 2023 at 10:52 AM).

  • 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.


    Thanks - that example helped - the problem/bug was related to the <level> usage.
    This will be fixed in the next release.

    About compatibility / policy - the main idea is to be as compatible as possible and do breaking changes only when not avoidable or the balance between being compatible and improve is more on the improve side...

  • Question about scrollarea

    I got the code here and put it inside a sidebar
    https://krpano.com/releases/1.21/…grid-layout.xml

    The middle part I used the code chunk here
    https://krpano.com/viewsource.htm…rea-infobox.xml

    See attached screenshot

    According to the docs "The scrollarea plugin needs to have a defined size and aligment and can be used only as children layer inside an other layer element."

    So On a resize event I try to compute / set the height of the middle section however when I try to get the heights of the header footer they're all null. How do set a height to the scrollarea parent in this case?

  • Question about scrollarea

    Please post your example (in a separate thread).

    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?


    There is a new onresize event.
    It works for all layers, not just textfields.
    It is basically the same as the onautosized event (which is still supported for compatibility).

  • 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?

  • 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?

    Something like this?

    Code
    <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);)" />

    See it here: https://krpano.kri-soft.be/examples/rightclickzoom/

    Edit: I noticed i simply did a zoom in/out, will see to have it "reset" after releasing the right click

    Edit: done - code and example updated...

  • I also tried the following code:

    Code
    <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);)" />

    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).

  • I also tried the following code:

    Code

    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).

    Brilliant my friend! Thank you very much for the hint, for this piece of code,
    for the sensible feedback. The second version is closer in meaning to what I wanted to implement.
    We can see this functionality in many games and this is quite an intuitive action, in addition,
    it can be provided with sound and additional overlays on the screen as in the game HALO Infinite ,
    and hotspots can also be highlighted in this mode, like the scan or vision modes of the Witcher.
    I would really like to somehow signal to Klaus that this is a very cool and cheap effect
    that could be implemented in many places. Of course, the context menu on the right key is also
    a very important and useful thing, but maybe move it to another hot key? What are your thoughts on this?

  • I think I found a bug, or at least some side behavior I don't like.
    It's case where the onup is not triggered.

    With this code:

    Code
    <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);)" />

    Do the following:

    Normal behavior:
    - richt click and hold in the panorama: the view is zoomed in
    - release right click: the view is zoomed to its original state

    Bugged behavior:
    - right click and hold in the panorama: the view is zoomed in
    - while HOLDING the right click still active, do a LEFT click: you can drag around in the pano while zoomed in
    - release the left click
    - release the right click: the onup event is not called and the zoom level is not reset to its original state

    In general, the onup() event is not called while the left mouse button is used in between the ondown and onup of the right mouse.

    Also, same behavior with my previous right mouse click zoom drag example above.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!