Image switching

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
User avatar
Taka
Posts: 51
Joined: Fri May 28, 2021 3:15 pm
Location: Tokyo

Hello.

Let me ask you a question.
I want the three elements to alternate one second at a time. (at the same coordinates)

I was able to use a timer to display the two elements alternately, but when it comes to three, I don't really understand.


I apologize for asking a simple question every time.
Thank you.
Attachments
image1.png
image1.png (98.44 KiB) Viewed 1653 times
User avatar
Hopki
Gnome
Posts: 13025
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
You can use a timer to add +1 to a number variable.
Then loop it back to 0.
So the variable will change to 0, 1, 2 then back to 0.
Then each image will have a visible logic block reacting to the number.
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/
User avatar
Taka
Posts: 51
Joined: Fri May 28, 2021 3:15 pm
Location: Tokyo

Thank you Hopki.
If you don't mind, could you tell me how to set variables a little more clearly?
It is a field I am not good at.
User avatar
Hopki
Gnome
Posts: 13025
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
No worries, this is used a lot in different projects, for example, the gallery component.
Please see attached project.

How it works.
First, set a numbered variable in the skin, I am using the variable name: var_change which starts at 0.
You will see three rectangles representing your three elements, Rectangle 1 to 3.
Each rectangle has visible deselected and a visible logic block and visible set up as so:

1.png
1.png (54.37 KiB) Viewed 1611 times

This is for Rectangle 1, RED.
So if the variable var_change = 0 it is visible.
Rectangle 2, Green will have the value set to 1 and Rectangle 3, Blue will have its value set to 2.

A timer is added to the skin set to Start, 0.5 seconds and Toggle.

2.png
2.png (32.25 KiB) Viewed 1611 times

The timer will spend 0.5 seconds Active, then 0.5 seconds Deactivate.
As I am only using the Activate source action it will take 1 second between active states.

The timer then has two actions, the first changes the variable value with each activate state:
So it is adding +1 to the variable number, counting up, 0, 1, 2 etc.

3.png
3.png (55.77 KiB) Viewed 1611 times

The second action loops the variable count:

4.png
4.png (61.16 KiB) Viewed 1611 times


Look at the action, when it gets to 3, it loops back to 0, so it does not actually get to 3.
The variable number will count: 0, 1, 2, 0, 1, 2 and so on.

As the variable, var_change counts the different Rectangles show and hide as their visible logic blocks react to the numbers.
Regards,
Attachments
NumberedVarible.zip
(12.96 KiB) Downloaded 111 times
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/
User avatar
Taka
Posts: 51
Joined: Fri May 28, 2021 3:15 pm
Location: Tokyo

Thank you Hopki :D
I'll try it right away.
User avatar
Taka
Posts: 51
Joined: Fri May 28, 2021 3:15 pm
Location: Tokyo

It went well!
Thank you. :D

I applied it to three patterns of floorplan map pins.
The number of nodes in floorplan is 250.

After adapting, I feel the project has become very heavy.
Are there any measures?
I want to keep it as comfortable as possible.
User avatar
Hopki
Gnome
Posts: 13025
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
It will help to understand more about your project and where this is being used.
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/
Post Reply