hudtxtalphafade - from 0 to 1
18 replies



30.03.20 09:06:21 pm
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
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
Well, it does not work for me... The hudtext alpha appears to be 1 right from the beginning
This is what I am doing:
First, I am setting the alpha value to 0
Code:
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
Code:
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
There's a bug where you cant set it to 0 milliseconds, put it at 1 millisecond and it'll work.
It's hard being the best girl in the whole entire world
I have done that and it still does not work

Code:
1
2
2
parse('hudtxtalphafade '..id..' 0 1 0)
parse('hudtxtalphafade '..id..' 0 1000 1)
parse('hudtxtalphafade '..id..' 0 1000 1)
parse('hudtxtalphafade '..id..' 0 1 0')
parse('hudtxtalphafade '..id..' 0 1000 0')
' is important
parse('hudtxtalphafade '..id..' 0 1000 0')
' is important

Kgb2d Community - Since 2012
What if you set a slight delay on the next
hudtxtalphafade ?

Code:
parse("hudtxtalphafade "..id.." 0 1 0")
timer(1,"parse","hudtxtalphafade "..id.." 0 1000 1")
timer(1,"parse","hudtxtalphafade "..id.." 0 1000 1")


@
Cure Pikachu: It also does not work


@
Bowlinghead: I am using the right ID


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.
Shit your pants:
Outlast II Mod (29) | Create your UI faster: CS2D UI Framework


No, the correct way to do it:
this is an example from me:
this is an example from me:
Code:
1
2
3
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")
parse('hudtxtalphafade 0 4 4000 0') --will be done in 4 secs
timer(4000,"parse","hudtxtalphafade 0 4 4000 1")
Kgb2d Community - Since 2012
@
BcY: What's the difference between yours and the aforementioned?

Shit your pants:
Outlast II Mod (29) | Create your UI faster: CS2D UI Framework


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.
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.
Kgb2d Community - Since 2012
@
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
Shit your pants:
Outlast II Mod (29) | Create your UI faster: CS2D UI Framework


@
BcY: The only difference between your code and OP's code is optional values which don't affect the code technically.

Shit your pants:
Outlast II Mod (29) | Create your UI faster: CS2D UI Framework


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:
If the timer is set on 100ms it wont work:
The version with the timer works somehow....
If the timer is set on 200ms it will work:
Code:
1
2
3
2
3
parse('hudtxt2 '..id..' 0 "@@@@@@@@@@@@@@@@@@@@" 30 420')
parse("hudtxtalphafade " ..id.. " 0 0 0")
timer(200,"parse","hudtxtalphafade 0 0 500 1")
parse("hudtxtalphafade " ..id.. " 0 0 0")
timer(200,"parse","hudtxtalphafade 0 0 500 1")
If the timer is set on 100ms it wont work:
Code:
1
2
3
2
3
parse('hudtxt2 '..id..' 0 "@@@@@@@@@@@@@@@@@@@@" 30 420')
parse("hudtxtalphafade " ..id.. " 0 0 0")
timer(100,"parse","hudtxtalphafade 0 0 500 1")
parse("hudtxtalphafade " ..id.. " 0 0 0")
timer(100,"parse","hudtxtalphafade 0 0 500 1")



