Position of Gyro Button

  • I actually published my first job! It's a real estate tour.

    I have gryo activated, and I want to control the position of the button...but nothing seems to change its position.
    In the control bar layers, the button is already aligned right, that's the default, but when the tablet is held landscape, the button moves. I would like the button to always stay next to the fullscreen button, if possible.
    I think it has something to do with the resizing/positioning action, but I really can't understand that section of code.

    I removed the layers for the pan and tilt buttons (commented out), because I wanted the space, and they're not really needed. So that might affect the positioning too.

    Hopefully this newbie didn't get in too deep. The gyro button works, and I even have it changing color, but I can't control its position.

    If you want to take a look:
    http://www.sightagent.com/760newlins

    If you have any tips to offer, I would appreciate it.
    Thanks.

    v

  • Thanks. I'll try it but...

    This is the gyro layer in vtourskin.xml:

    Code
    <layer name="skin_btn_gyro"      style="skin_base|skin_glow" crop="0|384|64|64"  align="right"      x="40" y="0"  scale="0.5" onclick="switch(plugin[skin_gyro].enabled); switch(layer[skin_btn_gyro].crop, '0|384|64|64', '64|128|64|64'); if(plugin[skin_gyro].enabled, skin_showmap(false));" visible="false" devices="html5" />


    Align is already in there. I tried many things, with align and with x=, and nothing changes it.
    There is an action called skin_arrange_buttons that does a lot of stuff that I can't begin to understand.
    Trying to understand what someone else wrote is difficult for me. I even forget things I wrote a week ago.

    v

  • Man you must understand code flow. Your skin_btn_gyro layer definition is something that is defined and valid in case you don't have actions that are overwritting/redefining this same layer attributes.
    Like in this case, your alignment is in the code set to right but than action skin_arrange_buttons is started and there you see one line:
    set(layer[skin_btn_gyro].align, ??);
    which is changing alignment of your button, so from this moment, you see, your first definition is not important. Focus now on this action and learm what this action is doing to your layer.

  • Thanks.
    Yes, I concluded that the skin_arrange_buttons action will re-arrange the buttons.
    I can't understand how the action works, or what settings to adjust.

    Just thought maybe someone else had already gone thru this. Of course, the easy answer is to simply disable gyro.

    v

  • Hi,

    right, the 'skin_arrange_buttons' action will place the buttons.

    Dynamically depending on the screen size and if it's a mobile device, the arrow buttons will be display or not.

    When the arrow buttons will be shown ('show_dirbuttons'), then the gyro button (and the vr button) will be placed right of them (typically on tablet devices),

    without array buttons the gyro will be placed on the left side, but it's exact position still depends if there will be the prev/next buttons and the thumb and map buttons.


    If you don't want any dynamic/automatic button placement, remove that action and define the positions in the <layer> elements.

    Best regards,
    Klaus

  • Hello, Klaus. Thank you.

    I'm still deciding how to proceed. I have removed the arrow buttons, but kept the + and - buttons. I still want the + and - to disappear on a small screen, or if the window is resized to a small size...so I guess I need to keep "skin_arrange_ buttons" action. Maybe I can remove just the sections that control the gyro button. That will take a lot of trial and error I suppose.

    I realize that experienced and professional programmers, or code writers, get annoyed with simple newbie questions. I would too!
    But I do research and think thru a problem before I ask for help. Sometimes I find an answer myself, sometimes not.

    Thanks to all again.
    v

Jetzt mitmachen!

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