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.
Image switching
- Hopki
- Gnome
- Posts: 13029
- 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,
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/
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/
- Hopki
- Gnome
- Posts: 13029
- 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:
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.
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.
The second action loops the variable count:
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,
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:
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.
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.
The second action loops the variable count:
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 113 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/
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/
It went well!
Thank you.
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.
Thank you.
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.
- Hopki
- Gnome
- Posts: 13029
- 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,
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/
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/