Fading an object at runtime

View previous topic View next topic Go down

Fading an object at runtime

Post  phil on Tue Apr 28, 2009 1:37 pm

I have an object that I'd like to fade at runtime ... in UiKit, of course, I would just set alpha from 1.0 successively closer to 0.0. Is there an equivalent way to do this?

Note: the object is a plane with an image texture (if that helps).

Thanks,

-Phil

phil

Posts : 7
Join date : 2009-04-10

View user profile

Back to top Go down

Re: Fading an object at runtime

Post  uprise78 on Tue Apr 28, 2009 2:26 pm

Same thing as UIKit...just fade the alpha of your material.

Check out the wiki (http://sio2interactive.wikidot.com/) and look for the how to work with materials section. Also, check out sio2_material.h file.

If I recall, you can do it something like this (may or may not work...i dont have source in front of me right now):

Code:

someMaterial->alpha -= 0.2f;

uprise78

Posts : 228
Join date : 2008-10-31

View user profile

Back to top Go down

solved

Post  phil on Wed Apr 29, 2009 8:53 am

It's solved by setting _SIO2material->diffuse->w to the alpha value you want ...

phil

Posts : 7
Join date : 2009-04-10

View user profile

Back to top Go down

Re: Fading an object at runtime

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum