Forum

> > CS2D > Scripts > hudtxtalphafade - from 0 to 1
Forums overviewCS2D overview Scripts overviewLog in to reply

English hudtxtalphafade - from 0 to 1

18 replies
To the start Previous 1 Next To the start

old hudtxtalphafade - from 0 to 1

AtomKuh
User Off Offline

Quote
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

old Re: hudtxtalphafade - from 0 to 1

AtomKuh
User Off Offline

Quote
I have done that and it still does not work

1
2
parse('hudtxtalphafade '..id..' 0 1 0)
parse('hudtxtalphafade '..id..' 0 1000 1)

old Re: hudtxtalphafade - from 0 to 1

Masea
Super User Off Offline

Quote
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.

old Re: hudtxtalphafade - from 0 to 1

BcY
Reviewer Off Offline

Quote
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")

old Re: hudtxtalphafade - from 0 to 1

BcY
Reviewer Off Offline

Quote
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.

old Re: hudtxtalphafade - from 0 to 1

Masea
Super User Off Offline

Quote
@user BcY: But he doesn't want it to happen in 4 seconds. Those are optional. Read what OP said in the first place.
edited 1×, last 31.03.20 05:31:55 pm

old Re: hudtxtalphafade - from 0 to 1

AtomKuh
User Off Offline

Quote
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")
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview