placeholder and calculate

Q&A about the latest versions
Post Reply
Fgorge
Posts: 3
Joined: Mon Mar 29, 2021 2:16 pm

Hello,
I use placeholder $(ap) inside a TextBox to display the pan angle and I got negative value when I pan to the right and positive when I pan to the left.
I would like to inverse the value of $(ap) to get the opposite value.
Using javascript I would use :

Code: Select all

myVar = myVar *-1;

how to get this result using Pano2VR ?

Thanks,

FG
User avatar
Hopki
Gnome
Posts: 13024
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
You can add a variable, for example, pan_flipped
This would be a numbered variable.

Then add a text box with the text: Flipped: $(*pan_flipped)
Give the text box a Config Loaded, Go To URL action with:

Code: Select all

javascript:
player.addListener('positionchanged', function() {
   player.setVariableValue('pan_flipped', player.getPanNorth() *-1.0);
});
This will display the pan angle display flipped.
Regards,
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
Fgorge
Posts: 3
Joined: Mon Mar 29, 2021 2:16 pm

Thank you
Post Reply