Fullscreen - how do I detect it and hook an action to it?

  • So, dumb question, I know if I continue to look in the documentation I will find it somewhere, but I'm wondering how I can scale a plugin when the panorama goes to fullscreen (or, if it is already at fullscreen, to appear scaled already).

    Here is the example:

    http://iiswebdev.pacific.edu/cms-apps/marke…rtour-forum.asp

    When you click on the Map button, the map will appear (I will eventually have little hotspots on it). What I would like, is that if the map is visible and the pano goes fullscreen, for the map to scale up. Or, for the map to be scaled up already if the pano is fullscreen when the Map button is clicked.

    Here is my code for the map image and its background:

    And for the map button:

    And the "togglemap" action:

    (I know it probably wasn't necessary to post all of that code, but just in the interests of completeness.)

    I know the answer is probably painfully obvious, but I am making myself crazy over it.

    Thanks

    Edited once, last by pan-o-rama (September 1, 2010 at 7:09 PM).

  • Never mind, got it:

    Code
    <events 
        onenterfullscreen="set(plugin[map].scale, 1.0);set(plugin[map-bg].scale, 1.0);" 
        onexitfullscreen="set(plugin[map].scale, 0.5);set(plugin[map-bg].scale, 0.5);" 
        />

    But now I'm not sure how it will look on different screen sizes. I will try to see if I can scale it to a % of the screen size.

  • I think you can set the width and height values to % values, in which case you shouldn't even need to do anything else. Please let me know if you can't, because my project will require this when I get to the plugin coding part and it's best to avoid nasty surprises *g*

  • I think you can set the width and height values to % values, in which case you shouldn't even need to do anything else. Please let me know if you can't, because my project will require this when I get to the plugin coding part and it's best to avoid nasty surprises *g*

    Thanks Protected, I will check it out. What I would really like to do is have it fill the space, but stay a set number of pixels away from the sides. I will tinker with it further.

  • if(fullscreen == true , tween(PLUGIN XX.scale,1.3);,tween(PLUGIN XX.scale,1); );

    or something...

    PLUGIN XX should be: plugin[nameofplugin]

    hope i'm right and it helps..

    the comma , is the else..

    cheers

    Tuur *thumbsup*

  • I'm this very moment about to claw my eyes out due to the despair caused by repeatedly attempting and failing to do that (exept I want to set only one dimension and then scale the other according to the original aspect ratio). The % in width/height and "prop" options built into krpano are no good, because they only have in account the plugin's original width and height. My plugin changes sizes, and when that happens, krpano preserves the initial scaling and positioning, which means a huge mess on the panorama.

    I'm trying to obtain the viewer size in pixels from within the plugin, but I don't know how I should be doing it, so it's mainly trial and error.

    EDIT: Likewise, the scale parameter suggested by Tuur is also no good because the plugin's aspect ratio changes on its own.

  • i'm quite sure it works.. make the dots parent/child with the map!!

    but you can put all variables to the if and else...

    Tuur

    it looks like if you got it working..

  • I managed to fix this problem; a rendering problem (see my thread asking for help in the plugins forum) was interfering with the calculations but it is possible to calculate the dimensions from stageWidth and stageHeight, center the plugin but keep the EDGE attribute at lefttop and offset the edge within the plugin itself, since this option doesn't work well (it changes the edge by applying an offset calculated only once, when the plugin is instantiated, and therefore the results are broken once the plugin changes shape).

  • Hi,

    I'm not sure what you want to do,
    but when adding an own plugin RESIZE event krpano will not scale the plugin anymore,
    it will just pass the new size to the event and then the plugin must handle it's size by itself,
    with that you can also set the "width" and "height" attributes to let krpano use them
    for positioning but without any automatic scaling,

    and about plugin positioning - when you don't set "align" and "edge" to any value, then you can
    control the position also by yourself in the plugin code, krpano will not calculate or set the
    positions in any way in this case,

    best regards,
    Klaus

  • That's what I'm doing right now and it's working, it's just too bad there isn't a function call from the interface that would reposition the plugin allowing me to make use of the built-in positioning system in changing plugins!

  • Hi,

    That's what I'm doing right now and it's working, it's just too bad there isn't a function call from the interface that would reposition the plugin allowing me to make use of the built-in positioning system in changing plugins!

    but when you have a krpano RESIZE event in your plugin, you should be able to use the krpano positioning system...

    best regards,
    Klaus

Participate now!

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