anaglyph icon in default skin

  • hi all

    in 10 minutes solved a pending issue that i had lurking for years in my mind
    I think that it would be great to have some skin setting to add it, Klaus :)

    fast tutorial
    1 - copy icon_anaglyph.png from examples into skin folder

    2 - bellow skin_btn_vr definition add a similar definition to skin_btn_anaglyph

    <layer name="skin_btn_vr" style="skin_base|skin_glow" crop="0|0|80|64" align="center" x="+146" y="0" scale="0.5" onclick="webvr.enterVR();" />
    <layer name="skin_btn_anaglyph" style="skin_base|skin_glow" url="icon_anaglyph.png" align="center" x="+152" y="0" scale="0.53" onclick="switch(display.anaglyph);" visible="true"/>

    3 - define the variable that will help you show the anaglyph button (I'm always guiding myself through vr button)
    calc(show_vrbutton, webvr.isavailable == true);
    calc(show_anaglyphbutton, image.stereo == true);

    4 - make room for the extra button

    calc(show_dirbuttons, !device.mobile AND ((area.pixelwidth + 2*cpos) GT 600) );

    4.1 - under the skin_btn_vr placement actions define your anaglyph button actions too. Special attention to cpos and lpos.
    set(layer[skin_btn_vr].align, center);
    copy(layer[skin_btn_vr].visible, show_vrbutton);
    copy(layer[skin_btn_vr].x, cpos);
    if(show_vrbutton, inc(cpos,48));

    set(layer[skin_btn_anaglyph].align, center);
    copy(layer[skin_btn_anaglyph].visible, show_anaglyphbutton);
    copy(layer[skin_btn_anaglyph].x, cpos);
    if(show_anaglyphbutton, inc(cpos,80));

    4.2 - without direction buttons
    set(layer[skin_btn_vr].align, left);
    copy(layer[skin_btn_vr].visible, show_vrbutton);
    copy(layer[skin_btn_vr].x, lpos);
    if(show_vrbutton, inc(lpos,44));

    set(layer[skin_btn_anaglyph].align, left);
    copy(layer[skin_btn_anaglyph].visible, show_anaglyphbutton);
    copy(layer[skin_btn_anaglyph].x, lpos);
    if(show_anaglyphbutton, inc(lpos,80));

    all done

Participate now!

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