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 / Object fade

Author
Message
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 17th Aug 2016 15:21
Hi all,

So I can see that it's pretty straightforward to set object transparency when you want it to be totally on, totally off or read the alpha data from an external texture with an alpha map, such as a PNG file...

However, I'm looking for a way to actually gradually fade a 3D object from totally opaque to totally transparent. Is this currently supported?
JohnStabler
AGK Bronze Backer
11
Years of Service
User Offline
Joined: 16th Aug 2013
Location: Cardiff, Wales, UK
Posted: 17th Aug 2016 21:36 Edited at: 18th Aug 2016 10:44
Yes you can do it. Make sure that transparency is on using SetObjectTransparency(). Then use SetObjectColor(object, r, g, b, a) and change the alpha value. Unlike sprites, you can't change just a single colour at a time so you have to use a type to hold object ID and colour information and set all colours at once. I usually have something like this:

CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 18th Aug 2016 01:02
Delicious! Thank you John!

Login to post a reply

Server time is: 2024-11-17 11:06:46
Your offset time is: 2024-11-17 11:06:46