|
2 registered members (Grant, AndrewAMD),
911
guests, and 9
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Fading problem
#331729
07/05/10 22:37
07/05/10 22:37
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
PANEL* black_pan =
{
bmap = black;
layer = 100;
flags |= (TRANSLUCENT);
}
function einfaden()
{
black_pan.flags |= (SHOW);
while(black_pan.alpha != 100)
{
if(black_pan.alpha == 100) black_pan.flags &= (~SHOW);
black_pan.alpha += 5;
wait(1);
}
}
function ausfaden()
{
black_pan.flags |= (SHOW);
while(black_pan.alpha != 0)
{
if(black_pan.alpha == 0) black_pan.flags &= (~SHOW);
black_pan.alpha -= 5;
wait(1);
}
}
When I start it acknex say that the enigne has to shut down (Windows window that show that acknex has crashed)..WHY? Just simple fade in and fade out, it is a black tga...
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Fading problem
[Re: Liamissimo]
#331734
07/05/10 22:54
07/05/10 22:54
|
Joined: Aug 2007
Posts: 1,922 Schweiz
Widi
Serious User
|
Serious User
Joined: Aug 2007
Posts: 1,922
Schweiz
|
while(black_pan.alpha != 100) { if(black_pan.alpha == 100) black_pan.flags &= (~SHOW);
The code never reach the if() because the loop quits if pan.alpha = 100. The same in the function ausfaden() Better use in the if() " >= " or " <= " instead of " == ", vars have always a little inaccuracy...
Last edited by Widi; 07/05/10 22:55.
|
|
|
Re: Fading problem
[Re: Widi]
#331735
07/05/10 22:59
07/05/10 22:59
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
Sorry, can u give me an code example? tried several things based on your idea but I didn't get it. Just too late for my brain
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Fading problem
[Re: Liamissimo]
#331737
07/05/10 23:07
07/05/10 23:07
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
function einfaden() { black_pan.flags |= (SHOW); while(black_pan.alpha <= 100) { black_pan.alpha += 5; wait(1); } } function ausfaden() { black_pan.flags |= (SHOW); while(black_pan.alpha >= 0) { black_pan.alpha -= 5; wait(1); } }
Doenst work also?
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Fading problem
[Re: Liamissimo]
#331739
07/05/10 23:12
07/05/10 23:12
|
Joined: Aug 2007
Posts: 1,922 Schweiz
Widi
Serious User
|
Serious User
Joined: Aug 2007
Posts: 1,922
Schweiz
|
void EINBLEND_PANEL(PANEL* my_pan)
{
set(my_pan,SHOW);
for (my_pan.alpha = 0; my_pan.alpha < 50; my_pan.alpha += 15 * time_step) wait (1);
my_pan.alpha = 50;
}
void AUSBLEND_PANEL(PANEL* my_pan)
{
for (my_pan.alpha = 50; my_pan.alpha > 0; my_pan.alpha -= 10 * time_step) wait (1);
my_pan.alpha = 0;
reset(my_pan,SHOW);
}
The alpha goes here only to 50 because i use tga. Call the function like this: EINBLEND_PANEL(your_panel_name);
|
|
|
Re: Fading problem
[Re: Widi]
#331741
07/05/10 23:19
07/05/10 23:19
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
It is still crashing...I really dont know why  Copied everything from you and replaced the functions name to einblend_panel
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Fading problem
[Re: Widi]
#331743
07/05/10 23:34
07/05/10 23:34
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
Yes, you were right. SORRY, i am so tired I really forgot my other panel anmed just as my bmao pointer, that caused the error
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
|