Weird, weird new actions

  • In the old auto thumbnails it was very easy to make them open at start.

    You just added the openthumbs() action to your startup.

    So of course I looked for a similar actions in the new skins.
    And there it was skin_showthumbs();

    Just as simple, I thought.- But adding this gives me what you see below.
    I checked the button for opening them and as it also had some more for closing map I added it all.
    No Change.
    Then I accidentally resized the window and voila. There was my thumbs.
    If this is not a Bug I need a very clever explanation why it does not work.

    This skin needs you to change attributes several places just to do a simple thing as changing the height. And it is not very easy to find those places.
    A lot of things seems to me to be much more complicated then it needs to be.

    Hans

  • I have also checked if a standard output with the default untouched skin and without the map would work but same thing happens.

    The container you see is the <layer name="skin_scroll_container" type="container" bgcolor="0x000000" bgalpha="0.5" align="lefttop" width="100%" height="100%" x="0" y="0" maskchildren="true">

    There is something that makes it "hang" when you use the action at startup. The same action here on the button works perfect

    <layer name="skin_btn_thumbs" url="vtourskin.png" crop="0|128|64|64" align="leftbottom" x="50" y="4" scale="0.5" ondown="skin_buttonglow(get(name)); skin_showmap(false); skin_showthumbs();" onup="skin_buttonglow(null);" />

    Hans

  • Hi Hans,

    EDIT sorry, never mind

    edit: this could be woking nice:

    Code
    <events name="global" keep="true"
    		onloadcomplete="skin_showthumbs();set(events[global].onloadcomplete,null);" />

    OR:

    Tuur *thumbsup*

  • Don't forget the part:

    set(events[global].onloadcomplete,null);

    otherwise it shows the thumbs on every new pano, when they are hidden!

    I think because it first has to do some math and check how many thumbs etc ect
    And that happens after the startup.

    You could change that, i'm sure. But not like it is now.

    Tuur *thumbsup*

  • Hi,

    Zitat

    If this is not a Bug I need a very clever explanation why it does not work.

    it's not a bug, it's the way that skin is designed and working

    Explanation:
    The "skin_showthumbs" actions uses the absolute pixel size/height (pixelheight) of the "skin_scroll_layer" element, but at startup these values are not calculated. There need to be at least one frame be displayed until these sizes are available.

    A delayed call like this could do that in the "skin_startup" action - this calls the action in the next frame:

    Code
    delayedcall(0,skin_showthumbs());

    But if you want the thumbs to be opened at startup, I would recommend changing the default startp values.
    Change in the vtourskin.xml, in this line these values:

    Zitat

    <layer name="skin_thumbs" state="hidden" url="%SWFPATH%/plugins/scrollarea.swf" alturl="%SWFPATH%/plugins/scrollarea.js" direction="h" visible="false" align="top" width="100%" height="100" onloaded="skin_updatescroll();" />

    to these ones:

    Zitat

    <layer name="skin_thumbs" state="visible" url="%SWFPATH%/plugins/scrollarea.swf" alturl="%SWFPATH%/plugins/scrollarea.js" direction="h" visible="true" align="top" width="100%" height="100" onloaded="skin_updatescroll();" />

    Btw - if someone is interested why there is a 'state' setting and a 'visible' setting - the 'visible' setting is the normal plugin/layer setting can controls the visibility of the element itself, and the 'state' setting is a custom variable from the skin that stores the current state of the element - e.g. when the thumbnails are 'sliding out', then the state is already 'hidden'. This information is necessary for a good control, e.g. the thumbs button can be opened and closed anytime, also during the thumbs are actually sliding.

    Best regards,
    Klaus

  • Quoted
    <layer name="skin_thumbs" state="hidden" url="%SWFPATH%/plugins/scrollarea.swf" alturl="%SWFPATH%/plugins/scrollarea.js" direction="h" visible="false" align="top" width="100%" height="100" onloaded="skin_updatescroll();" />
    to these ones:

    Yes this one works fine for me. I did that on this.
    http://qtvr.dk/ryegaard/
    '
    But for some reason it does not work on Willy's page on iPad.
    http://www.kaemena360.net/FS/Innotrans20…otrans2012Tour/
    It shows up as a blink and then closes.
    I checked it and the xml for it is identical to mine.

    He may have done some small other changes somewhere, which for some reasion affects iPad only.

    Hans

  • Hi,

    thanks for that info!

    That was indeed an unexpected behavior - the reason is indirectly the 'gyro' plugin and the call of the 'skin_onresize' action when it is available:

    Zitat

    <plugin name="skin_gyro" ... onavailable="set(layer[skin_btn_gyro].visible,true); skin_onresize();" />

    In the "skin_onresize" action the state of the thumbnails bar and the map were checked here by these codes:

    Code
    if(layer[skin_thumbs].state == 'visible', ... );
    if(layer[skin_map].state == 'visible', ... );

    But when an action was called from an layer/plugin/hotspot element (like from the gyro plugin in this case), then the action has access to the 'local' settings/attributes of that plugin element, and in this case, access to the 'layer' elements of the plugin itself. But this is wrong in this case, the action should use the 'global' layer elements and check them. Because of this the size of that container of the thumb-bar was caluclated wrongly, and the thumbs were scrolled out of view.

    The real problem behind that issue is a bit more complex problem and I will work out a viewer internal solution for that, but for fixing the skin itself for this case, just remove the 'skin_onresize()' call from the gyro onavailable event, it is not really necessary there and would work also without:

    Zitat

    <plugin name="skin_gyro" ... onavailable="set(layer[skin_btn_gyro].visible,true); skin_onresize();" />


    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!