Reputation: 139
I'm creating an IOS game in AIR where you must shoot birds with certain numbers on them. A new bird spawns every 5 seconds or so, crosses the screen and gets removed after it leaves. I use TweenMax to tween the birds across the screen with a bezier curve. The game is rendered with GPU.
Here's the problem: When I add a dynamic textfield to the "bird" MC (so I can place a number on the bird), it makes the game unplayable: After 20 or so seconds (with maybe 4 birds on screen), the game begins to stutter and eventually halts completely. This is on an iPad 1.
What I've found:
I have NO idea what the problem is. I've tried creating the textfield as part of the movieclip AND creating it dynamically at runtime - no difference. I don't embed anything except numbers. I have tried using anti-alias, no anti-alias, device fonts - no difference.
I have NO idea why the presence/tweening of 4-5 dynamic textfields would create what looks like a huge memory leak. Anyone heard of this?
Upvotes: 0
Views: 723
Reputation: 5781
Rendering vectors in GPU mode is very slow, especially text (thin sharp shapes doesn't tesselate as well). My advice would be to render the textfield as a bitmap.
Upvotes: 2