direct.showbase.Transitions
from direct.showbase.Transitions import Transitions
This module defines various transition effects that can be used to graphically transition between two scenes, such as by fading the screen to a particular color.
Inheritance diagram
- class Transitions(loader, model=None, scale=3.0, pos=LVector3f(0, 0, 0))[source]
Bases:
object
- FadeModelName = 'models/misc/fade'
- IrisModelName = 'models/misc/iris'
- fadeIn(self, t=0.5, finishIval=None, blendType='noBlend')[source]
Play a fade in transition over t seconds. Places a polygon on the aspect2d plane then lerps the color from black to transparent. When the color lerp is finished, it parents the fade polygon to hidden.
- fadeOut(self, t=0.5, finishIval=None, blendType='noBlend')[source]
Play a fade out transition over t seconds. Places a polygon on the aspect2d plane then lerps the color from transparent to full black. When the color lerp is finished, it leaves the fade polygon covering the aspect2d plane until you fadeIn or call noFade. lerp
- fadeScreen(self, alpha=0.5)[source]
Put a semitransparent screen over the camera plane to darken out the world. Useful for drawing attention to a dialog box for instance
- fadeScreenColor(self, color)[source]
Put a semitransparent screen over the camera plane to darken out the world. Useful for drawing attention to a dialog box for instance
- getFadeInIval(self, t=0.5, finishIval=None, blendType='noBlend')[source]
Returns an interval without starting it. This is particularly useful in cutscenes, so when the cutsceneIval is escaped out of we can finish the fade immediately
- getFadeOutIval(self, t=0.5, finishIval=None, blendType='noBlend')[source]
Create a sequence that lerps the color out, then parents the fade to hidden
- irisIn(self, t=0.5, finishIval=None, blendType='noBlend')[source]
Play an iris in transition over t seconds. Places a polygon on the aspect2d plane then lerps the scale of the iris polygon up so it looks like we iris in. When the scale lerp is finished, it parents the iris polygon to hidden.
- irisOut(self, t=0.5, finishIval=None, blendType='noBlend')[source]
Play an iris out transition over t seconds. Places a polygon on the aspect2d plane then lerps the scale of the iris down so it looks like we iris out. When the scale lerp is finished, it leaves the iris polygon covering the aspect2d plane until you irisIn or call noIris.
- letterboxOff(self, t=0.25, finishIval=None, blendType='noBlend')[source]
Move black bars away over t seconds.
- letterboxOn(self, t=0.25, finishIval=None, blendType='noBlend')[source]
Move black bars in over t seconds.