Transitions

Hello, in my game I am trying I am trying to make the screen fade in from black. My code wasn’t working correctly, so I made a test file to see if the transition would work. When I run this:

from direct.directbase import DirectStart
from direct.showbase.Transitions import Transitions

fadeIn = Transitions(loader)
fadeIn.setFadeColor(0,0,0)
fadeIn.fadeIn(2)

run()

the fade in never happens. Can someone tell me how to get this to work?

I think I remember an old member from the forums mentioning that the Transitions class had a bug few years ago and that’s why it didn’t work as expected. Maybe it hasn’t been fixed yet.

Just create your own black or white plane with the CardMaker class, parent it to render2d or aspect2d and call setColorScale or setAlphaScale intervals one it.
Like this you can even have textured planes for your transitions.

That’s what I ended up doing, thank you for your help.