Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by fulvio

I use the following to fadeout text:

if (this.fadeOut) {
    if (this.idleTimer.delta() > this.lifetime) {
        return;
    }
    this.font.alpha = this.idleTimer.delta().map(this.lifetime - this.fadetime, this.lifetime, 1, 0);
}

What's the best approach to fadein text if the alpha is 0 at init?

1 decade ago by Joncom

Just the opposite should work fine, no?

In init set this.fadeIn = true;.

Then in your update function:

if (this.fadeIn) {
    // Move .alpha towards 1 instead of 0.
}
Page 1 of 1
« first « previous next › last »