2D Toolkit Forum
2D Toolkit => Support => Topic started by: Hamlet Archer on November 04, 2012, 02:21:05 am
-
Hello! I cannot get the tk2dCamera to work with the iTween.CameraFade. I use the following code to fade in the whole scene:
iTween.CameraFadeAdd(cameraTexture, 100);
iTween.CameraFadeFrom(1, 1);
The fade works on the default Unity camera, but not on the tk2dCamera. Is there a way to get 2D Toolkit to work with iTween? Or might there be a convenient way to fade in/out stuff without having to setup my own custom overlays? Thanks! ;D
-
looking through the itween code, i think i have found the answer to my own question:
the iTween.CameraFadeAdd creates a GUITexture as overlay, which is not rendered in the default tk2dCamera because it doesn't have a GUILayer component. it works once i have added that... just in case anyone else runs into the same problem. :P
-
Hi Hamlet, you can create a full screen black sprite (just a tiny sprite scaled up loads).
You can then fade that in/out manipulating the .color.a - this way you don't have to add an additional camera.
-
Thanks! I agree it's better to not add a camera just for that fade effect. I just didn't understand why it wasn't working before... Thanks for responding though. ;)