HUD fades after a period of time

Get help using Construct 2

Post » Fri Feb 14, 2014 12:21 am

Hey Construct community,

I'm trying to get my HUD to fade away after it has not been in use for 10 seconds, as seen in Skyrim (it disappears if health is full and not in combat). I've tried using instance timers and global timers to no avail, and I'm stumped. Any ideas?

Thanks.
B
22
S
4
G
1
Posts: 153
Reputation: 1,938

Post » Fri Feb 14, 2014 12:38 am

Weird, I've used Global HUD timers in my own game just fine. how exactly are you implementing them?

FYI Here's how I have it set up in mine, mine has the HUD scroll upward out of view. Although you could easily do the same with opacity

GV: HUD

If
HUD > 0
Then
Set Each hud piece to lerp(X,32,dt),lerp(Y,32,dt)
and
Set HUD to Clamp(0,10, HUD-dt)
Else
Set Each hud piece to lerp(X,-32,dt),lerp(Y,-32,dt)

On Even to Bring up Hud (Say Health<100)
Set HUD to 10
B
53
S
11
G
7
Posts: 184
Reputation: 6,975

Post » Fri Feb 14, 2014 1:07 am

Wow, I forgot to try changing the opacity through events. I was using the built-in Fade behavior. I'll see if I can make it work through changing the opacity.
B
22
S
4
G
1
Posts: 153
Reputation: 1,938

Post » Fri Feb 14, 2014 3:52 am



So, basically, after your events happen (PlayerHealth = 100% and TouchCounter = 0) or whatever. Set the layer opacity from 0 to 1.Tekniko2014-02-14 03:54:49
B
56
S
15
G
13
Posts: 826
Reputation: 17,645


Return to How do I....?

Who is online

Users browsing this forum: adventurist, Artcadev, Blendi1223, PROxMTswatTR and 28 guests