Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Sprite Alpha problem

Author
Message
ohsuplol
15
Years of Service
User Offline
Joined: 21st Apr 2009
Location:
Posted: 21st Apr 2009 08:41
So I have 1 sprite drawn on the screen, it is acting as an
"intro" so what i want it to do is fade in, then fade out. It fades in perfectly, but it wont fade out. I set many breakpoints in the code and the loops are working as they should, but for some reason the alpha is not being changed in the 2nd loop.

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 21st Apr 2009 15:48
try this:

Quote: "
dbSetSprite (1, 1, 1);
dbSprite (1,0,0,1);
dbSetSpriteAlpha (1, 0);

int i;

for(i=0; i<50; i++)
{
dbSleep(50);
dbSetSpriteAlpha(1,i);
dbSync ();
}

for(i=50; i>1; i--)
{
dbSleep(50);
dbSetSpriteAlpha(1,i);
dbSync ();
}

dbSetSpriteAlpha(1,0);
"
ohsuplol
15
Years of Service
User Offline
Joined: 21st Apr 2009
Location:
Posted: 21st Apr 2009 18:44
Thanks for replying, I tried what you suggested and it yielded the same results. I set a break point at dbSetSpriteAlpha(1,i) in the second loop and watched int i count down but the alpha not changing.
have no idea what could be causing this.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 22nd Apr 2009 21:13
Try dbCLS() after syncing...

ohsuplol
15
Years of Service
User Offline
Joined: 21st Apr 2009
Location:
Posted: 23rd Apr 2009 01:43
Quote: "Try dbCLS() after syncing..."


Excellent, tried and tested and it works.
Thanks very much.

Login to post a reply

Server time is: 2024-09-30 23:12:04
Your offset time is: 2024-09-30 23:12:04