Forum

> > CS2D > Scripts > hudtxtalphafade - from 0 to 1
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch hudtxtalphafade - from 0 to 1

18 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt hudtxtalphafade - from 0 to 1

AtomKuh
User Off Offline

Zitieren
I am trying to do hudtxtalphafade from alpha 0 to alpha 1.

This is what I am doing:

First, I am setting the alpha value to 0
1
parse('hudtxtalphafade '..id..' 0 0 0)
0 - terminal ID
0 - duration (because it should be alpha 0 instantly)
0 - alpha value

After that, I want the hudtxt alpha to be 1 in 1000ms
1
parse('hudtxtalphafade '..id..' 0 1000 1)

Well, it does not work for me... The hudtext alpha appears to be 1 right from the beginning

alt Re: hudtxtalphafade - from 0 to 1

Masea
Super User Off Offline

Zitieren
This happened to me not too long ago, but god knows what exactly my fix was back then. Try playing with the timer time, set it to something like 100ms or maybe a little lower until you see it is working.

alt Re: hudtxtalphafade - from 0 to 1

BcY
Reviewer Off Offline

Zitieren
No, the correct way to do it:

this is an example from me:
1
2
3
parse('hudtxt 4 "'..os.date("Time:©255255255 %I:%M %p %A, %d %b %Y")..'" 300 472 0 0 5')
parse('hudtxtalphafade 0 4 4000 0') --will be done in 4 secs
timer(4000,"parse","hudtxtalphafade 0 4 4000 1")

alt Re: hudtxtalphafade - from 0 to 1

BcY
Reviewer Off Offline

Zitieren
The timer(second alphafade) starts when the first alphafade stops.

The details are important.
parse('hudtxtalphafade 0 4 4000 0') --will last 4 seconds
timer(4000,"parse","hudtxtalphafade 0 4 4000 1") --starts in 4 seconds so it will be executed when the first alpha fade ends.

alt Re: hudtxtalphafade - from 0 to 1

Masea
Super User Off Offline

Zitieren
@user BcY: But he doesn't want it to happen in 4 seconds. Those are optional. Read what OP said in the first place.
1× editiert, zuletzt 31.03.20 17:31:55

alt Re: hudtxtalphafade - from 0 to 1

AtomKuh
User Off Offline

Zitieren
First of all, thanks for all ur answers

The version with the timer works somehow....

If the timer is set on 200ms it will work:

1
2
3
parse('hudtxt2 '..id..' 0 "@@@@@@@@@@@@@@@@@@@@" 30 420')
parse("hudtxtalphafade " ..id.. " 0 0 0")
timer(200,"parse","hudtxtalphafade 0 0 500 1")

If the timer is set on 100ms it wont work:

1
2
3
parse('hudtxt2 '..id..' 0 "@@@@@@@@@@@@@@@@@@@@" 30 420')
parse("hudtxtalphafade " ..id.. " 0 0 0")
timer(100,"parse","hudtxtalphafade 0 0 500 1")
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht