Skip to content

Texture atlas using singleton issue. #2759

Answered by Geokureli
cloudssky1997 asked this question in Q&A
Discussion options

You must be logged in to vote

My guess is that it has something to do with when fromTexturePackerJson is being called. with the singleton above it is called whenever TPSingleton is first referenced, which may be before flixel is even created. if you had more control over it's construction, by having a static init or create method, you may have better luck.

it's also worth mentioning that graphics and bitmaps are destroyed on state switches to clear up memory, that likely isn't the cause here but its something you'll need to think about as it will render cached atlases useless with the way you're doing it. you could set `the atlas's graphic to avoid being destroyed.

combining both these recommendations would look somet…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Geokureli
Comment options

@cloudssky1997
Comment options

Answer selected by cloudssky1997
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants