Best Practice when building skins

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
User avatar
Posts: 10853
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK

Thu Apr 25, 2019 2:19 pm


We had a question come in regarding best practices for buttons.
This was about the Fullscreen button which has two buttons that will show the two different states, Enter and Exit Fullscreen.

The e-mail then when on to ask should the actions be in each button with actions to also hide and show the other button, so creating a toggling effect between the two.

I thought this was a good question and to this end bring your attention to the default skins, namely the Silhouette V6 skin.

If you open it up in the skin editor and scroll down to the "controller" container and expand it in the tree you will see "controller_slider", also expand this in the tree.

1.png (108.91 KiB) Viewed 3826 times

What you will see is the buttons that have different states such as Fullscreen are in containers.

The Skin was designed so that if you wanted you can map the keyboard to the buttons.

Looking at the Fullscreen button, the container, "fullscreen_buttons" has the one action which is Toggle Fullscreen. So a single key can be mapped to it, in this case, I have mapped the F key.

2.png (8.03 KiB) Viewed 3826 times

The buttons change by using the Alpha logic block using the trigger Fullscreen.

3.png (31.04 KiB) Viewed 3826 times

So if Fullscreen is true the Enter Fullscreen button hides by changing the alpha to 0.00 and the Exit Fullscreen button shows.

Otherwise, if the actions were in the buttons then you would need to map two keys.

This gets a bit more interesting if there are more than two states, for example, the Projections button.
This has three states but to be able to still use a single keyboard key it uses action filters.

If you look at the last three actions in the container, projection_buttons you will see that there is a mouse click, change projection for each projection type.

4.png (23.28 KiB) Viewed 3826 times

So not all three projections are select at once there are actions filters in the actions. This is denoted by the * 
The panorama opens in the Rectilinear Projection.
The first action to change to Stereo has the action filter:

5.png (27.63 KiB) Viewed 3826 times

So only this action will be actioned as the others have different projections:
The second action has the filter:

6.png (27.49 KiB) Viewed 3826 times

And the last has:

7.png (26.41 KiB) Viewed 3826 times

So in this case, because we wanted you to be able to map the keyboard to the buttons this was the best practice for the default skins.
I hope this has given you a bit of insight into the thought process behind this skin and gives you food for thought when building your own, more so when building components to use with other projects.

Garden Gnome Software Support
If you send an e-mail to support please send a link to the forum post for reference.
Post Reply