if then else in pn2vr ?

Q&A about the latest versions
Post Reply
User avatar
dePassage66
Posts: 86
Joined: Mon Mar 20, 2023 11:19 am

Hi to all,

Is there a way to use something like if then else in coding ?

I have two variables called :
_tooltip = true/false
_tooltip_txt = txt

When the mouseEnter an icon, I set the txt of the var _tooltip_txt to what I want
Then, the field show the txt of the variable _tooltip_txt

No problem until here.

What I try to find out is how I show or hide the tooltip field depending of the state of the var _tooltip
True I show the field, false I hide the field.

I suppose I must put a condition but where ?
That's my question :wink:

I suppose it can be easy for some of you, so forgive me because I'm really new to pn2vr !

Regards,
Attachments
Capture d'écran 2023-10-11 215857.gif
Capture d'écran 2023-10-11 215857.gif (68.8 KiB) Viewed 1505 times
pour Visites Guidées Panoramiques https://www.visitespanoramiques.com/index.html
(sorry, no translation available yet!)
User avatar
Tony
Posts: 1342
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Hi,

Basically you need to add some logic blocks to manage the visibility of the tooltips.

I've put together a small project that illustrates the use of the logic blocks. You can see the output here https://p2vr.s3.ap-southeast-2.amazonaw ... index.html

preview.jpg
preview.jpg (298.05 KiB) Viewed 1498 times

I've used your variable names and added a button that toggles the _tooltip variable. You can see the use of the Visible logic block in the next screenshot.

tooltips.jpg
tooltips.jpg (1.54 MiB) Viewed 1498 times

I've also exposed the variable in the Edit Skin Configuration

tooltips_ext.jpg
tooltips_ext.jpg (52.65 KiB) Viewed 1498 times

You can download the project here https://p2vr.s3.ap-southeast-2.amazonaw ... ooltip.zip


Regards,

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: https://tonyredhead.com - https://redsquare.com | Pano2VR Tutorials: https://tonyredhead.com/pano2vr | instagram: https://www.instagram.com/tonyredhead/
User avatar
dePassage66
Posts: 86
Joined: Mon Mar 20, 2023 11:19 am

Thank you very much Tony for this tutorial!

I didn't imagine the hierarchy of objects in this way but it's very interesting to explore further.
I understood that the sign Not(sign) means toogle, finally.
And not only that :wink:

Image

Have a good day,
Regards,
Attachments
Capture d'écran 2023-10-12 102117.png
Capture d'écran 2023-10-12 102117.png (27.13 KiB) Viewed 1490 times
pour Visites Guidées Panoramiques https://www.visitespanoramiques.com/index.html
(sorry, no translation available yet!)
Post Reply