Hsaka Posted March 17, 2014 Share Posted March 17, 2014 Hello, I'm experiencing some performance issues with BitmapText. In one screen in my game, I have 4 BitmapText objects and the fps in CocoonJS drops to around 45. Correct me if I'm wrong, but looking at the source, it seems that a BitmapText object is a display object container where each character in the bitmap text is a sprite. If this is true, then is it possible to incorporate a SpriteBatch instead of DisplayObjectContainer in BitmapText to contain all of these sprites? And will doing so improve its performance? Quote Link to comment Share on other sites More sharing options...
bubamara Posted March 18, 2014 Share Posted March 18, 2014 are those 4 BitmapTexts sharing same texture?If not, try to make one texture for all fonts as changing texture states is a big no-no in webglIdeally, all your sprites in scene should share same texture Quote Link to comment Share on other sites More sharing options...
Hsaka Posted March 18, 2014 Author Share Posted March 18, 2014 Hey, thanks for the suggestion but unfortunately, they are all using the same texture. Quote Link to comment Share on other sites More sharing options...
CinkoNaap Posted March 18, 2014 Share Posted March 18, 2014 I also came into this, it terribly drops FPS count ( especially if your text is nested in some additional DoC ).If you have multiple static text in some container, you can cacheAsBitmap bitmapText and container itself, it did the trick for me in simple example.Unfortunately, cacheAsBitmap is not working perfectly too, sometimes it trims part of your content ( I think because of bad bounds calculating, when the container is scaled ). Hsaka 1 Quote Link to comment Share on other sites More sharing options...
Hsaka Posted March 20, 2014 Author Share Posted March 20, 2014 Hi, thanks for that tip. It turns out that the fps only drops when using WebGL. If I force Canvas mode, I get a steady 60 fps even with many BitmapText objects on the screen. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.