Is there an easy way to make an icon/image or whatever to blink? I mean switching enabled and disabled state with the CGI Panel window when I run the player?
For example, I would like the icon to keep switching between on and off for an alarm indication.
Hello,
Yes, this can be achieved using the CGI Panel by switching the icon between its enabled and disabled states, similar to a toggle.
To toggle an icon through the CGI Panel, you need to have a control associated with the icon. The control can be either a built-in control or a custom control.
For this example, we will use a Toggle Button and configure it to continuously switch between its ON and OFF states.
You can follow these steps:
Add a Toggle Button
First, drag and drop a Toggle Button into your scene.
Open the CGI Panel
Click the Play button to run the scene. This will open the CGI Panel window.
Select the Scene
In the CGI Panel, select the scene where you added the Toggle Button.
In this example, select Scenes#Scene2D.
Open Controls
Select the Controls option.
Select the Toggle Button
You will see the controls available in the selected scene. Select the Toggle Button.
Enable Value Simulation
The properties of the Toggle Button will be displayed. Enable Simulation of the value for the required property.
Open the Value Generator
Go to the Value Generator tab.
Set the Maximum Value
Change the Maximum value to 1.
Set the Period
Change the Period to 500 ms. This makes it easier to observe the control switching between its enabled and disabled states.
Select the Toggle Wave
Open the drop-down list next to the Wave option. From the available wave types, select Toggle.
Start Value Generation
Start the Value Generation mode using the Start/Stop control.
Observe the Result
The Toggle Button will now continuously switch between its ON and OFF states. You can use the same approach to make an icon continuously switch between its enabled and disabled states, creating a blinking effect.
For a better understanding, you can also refer to the screenshots below, which show each step in the CGI Panel.