UI Element Fade on Detection by zgloug

Have something important that other people might find usefull? Well, drop it here and help others!
User avatar
LucidStew
Level 3
Level 3
Posts: 180

UI Element Fade on Detection by zgloug

Post#1 » Mon Aug 15, 2016 6:29 pm

moved over from projectspark.com forums

The UI elements (icons, text, images) are displayed without fade. They appear and disappear at once, much like when a switch to light a lamp.

But before, Spark Project showed these UI elements with a fade effect. They appeared and disappeared gradually, much like when increasing or decreasing the intensity of a lamp.

Here's an example. A wooden panel displays with fade-in a line of text when it detects the player. The text disappears in fade-out when no more player is detected.

When: Once Do: (number var)MyOpacity, equals, 0
When: Once Do: (number var)Step, equals, 0.15
When: MyOpacity, greater than, 0 Do: display, [what you want], above, opacity, MyOpacity
When: started to, detect, player Do: (boolean var)DetectMe, equals, true
When: no longer, detect, player Do: DetectMe, equals, false
When: DetectMe
- When: MyOpacity, less than, 1 Do: MyOpacity, increment by, Step
When: not, DetectMe
- When: MyOpacity, greater than, 0 Do: MyOpacity, decrement by, Step
End of line.

Return to “Tutorials and guides”

Who is online

Users browsing this forum: No registered users and 2 guests

cron