HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.92k stars 427 forks source link

Modify FlxText to create a bitmap with an informative key. #3181

Closed EliteMasterEric closed 3 weeks ago

EliteMasterEric commented 3 weeks ago

In the past, I've had to look over the list of graphics in the BitmapFrontEnd cache to determine the cause of memory issues.

In this circumstance, having readable keys is important; for example, if one bit of text appears in the cache a lot, there may be something forcing it to re-render too often.

This PR changes auto-generated graphics created by FlxText to include the actual text in their key (text123 will instead be text(Hello World)123). This shouldn't have any negative impact but should improve debugging.

Geokureli commented 3 weeks ago

This seems relevant to: https://github.com/HaxeFlixel/flixel/issues/3081

I'd like to determine whether this affects memory leaks resulting from FlxText bitmap keying