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.

AppGameKit Classic Chat / Will it be possible to fade one image into another in V2?

Author
Message
NoUJoe
11
Years of Service
User Offline
Joined: 8th Jul 2013
Location:
Posted: 10th Oct 2013 07:07
To my knowledge at the moment, it is not possible to control the opacity of sprites in AGK. But after seeing the latest shaders video, I was wondering if it would possible to do this? Just say I have one image and another on top of that, then turn down the opacity over a certain period of time to give the effect of one fading into the other.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 10th Oct 2013 08:29
If all you want to do is change the opacity of the entire sprite you can already do that with setspritecoloralpha().

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 10th Oct 2013 14:12
means
setspritecoloralpha(spr1,0-255)
setspritecoloralpha(spr2,255-0)
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 10th Oct 2013 14:33
Yeah, a little For...Next loop setting the alpha of each sprite and a sync is probably all that's needed.

You can even change the colour of a sprite - like maybe have a sprite fade to black before fading out, or have a lightning effect if you like. You can even make a copy of a sprite, change it's colour to black with 50% alpha setspritecolor(spr,0,0,0,128) and use it as a drop shadow.

I am the one who knocks...
NoUJoe
11
Years of Service
User Offline
Joined: 8th Jul 2013
Location:
Posted: 11th Oct 2013 07:05
Wow sorry I really didn't realise that these functions were in agk. Brilliant. I do have Hands On AppGameKit Basic, but I'm only about 400 pages through (im on file handling atm) and haven't reached sprite control etc in detail yet. Thanks a lot tho!!
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 11th Oct 2013 10:18
book?! I HATE book!! book is stupid!!!

^ Sorry, old joke there for the old timers!

On a serious note, I think the actual solution has already been proposed so ignore me.

Login to post a reply

Server time is: 2024-11-24 23:06:26
Your offset time is: 2024-11-24 23:06:26