11/07/2009

Tweening texts kills FPS?

Long time no see!

It has been a while since I made my last post. In order to kill this spare time, I thought it'd be cool to bring this blog back to life.

I'll start with this tech post explaining difficulties I had with Flash text rendering system.

In my latest game, Darkness 2, there is a simple intro, with animated texts. Even though there may be only one simple text with 'Readable' Anti-Alias on-screen at a time, the framerate would drop between the alpha tweens, and even when the text was static on screen.

The workaround for this would be simply breaking the text appart, but the FPS got even lower:

So I created a separate project, applied the text with the same font and settings, and tried tweening the text with the same tween. The result?


What's the problem? Wasn't it supposed to run at the same speed? Would it be somehow an issue with the project itself? Well, seems so, because after a little experimentation I found out that a simple white backdrop that was tweening at a lower layer of the intro MC to make the transition effect was forcing the text movieclip to re-render every frame.

It wasn't even supposed to behave like that, after all, the tweening backdrop was behind all the other elements, including the texts, and when the text was idle, so was the backdrop tweening.

I guess after that I'll have to stick back to .png texts, faster, better and looks nice.

-Luiz

No comments: