I have tried and tried to get OnscreenText to work with a LerpColorInterval and have been unable to do so. I assume this is because it will not work. Is that due to the fact that it doesn’t have a ‘color’ attribute but instead a fg and bg color?
Also, what would be a good way to lerp the color of text if the LerpColorInterval will not work?
Try a LerpColorScaleInterval instead:
from direct.directbase.DirectStart import *
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.gui.OnscreenText import OnscreenText
text = OnscreenText('howdy', scale = 0.1, fg = VBase4(1, 1, 1, 1))
i = Sequence(LerpColorScaleInterval(text, 1, VBase4(0, 0, 0, 1)),
LerpColorScaleInterval(text, 1, VBase4(1, 1, 1, 1)))
That seems to have worked. Thanks David