|
alpha problem with sprites
#254743
03/05/09 06:37
03/05/09 06:37
|
Joined: Feb 2007
Posts: 353
amy
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2007
Posts: 353
|
I do an alpha fade from 0% to 100% alpha. With a model entity it works without problems. With the same code a sprite entity stays invisible from 0% to 50%. This looks like a bug to me. my code: void fadein(ENTITY *e, var seconds)
{
var ticks = seconds * 16;
reset(e, INVISIBLE);
e.alpha = 0;
while(e.alpha < 100) {e.alpha = minv(e.alpha + 100/ticks * time_step, 100); wait(1);}
} the TRANSLUCENT flag is set.
|
|
|
Re: alpha problem with sprites
[Re: amy]
#254745
03/05/09 07:51
03/05/09 07:51
|
Joined: Jul 2000
Posts: 28,024 Frankfurt
jcl

Chief Engineer
|

Chief Engineer
Joined: Jul 2000
Posts: 28,024
Frankfurt
|
|
|
|
Re: alpha problem with sprites
[Re: amy]
#254753
03/05/09 08:42
03/05/09 08:42
|
mercuryus
Unregistered
|
mercuryus
Unregistered
|
Has your sprite an alpha channel? (tga/dds)? GS can't handle this full fading because of some reasons.
|
|
|
Re: alpha problem with sprites
[Re: amy]
#254754
03/05/09 08:42
03/05/09 08:42
|
Joined: Aug 2008
Posts: 2,838 take me down to the paradise c...
Cowabanga
Expert
|
Expert
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
|
function fadein()
{
set(my,TRANSLUCENT);
while(1)
{
my.alpha += 5*time_step
if(my.alpha == 100){break; reset(my,TRANSLUCENT);}
wait(1);
}
} Just an idea.  EDIT: Or use the fade in example in the manual: set(my,TRANSLUCENT);
for (my.alpha=0; my.alpha+=5*time_step; my.alpha<100) wait(1);
reset(my,TRANSLUCENT);
Last edited by Cowabanga; 03/05/09 08:50.
|
|
|
Re: alpha problem with sprites
[Re: Cowabanga]
#254756
03/05/09 08:54
03/05/09 08:54
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Try changing the line reset(e, INVISIBLE); to be reset(e, INVISIBLE|OVERLAY); and see if it makes a difference.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|