-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tilemap object edge cases causing crashes #6945
Conversation
Extensions/TileMap/JsExtension.js
Outdated
_placeholderTextNoAtlasPixiObject = new PIXI.Text( | ||
'Set up an atlas image\nin the tilemap object.', | ||
new PIXI.TextStyle({ | ||
fontFamily: 'Arial', | ||
fontSize: 16, | ||
align: 'center', | ||
padding: 5, | ||
}) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if you should change the text of 1 PIXI.Text
instead of creating one for each message.
Also, should the placeholders only be instanciated if you actually need them to reduce memory footprint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes good idea, it was not optimal, I use only one text now.
Regarding the instanciation, I'd rather do pixi container manipulation in the constructor only and then only switch visibility but if you think it's important, I can change this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's it indeed safer to:
- instantiate what you need (even things that will be hidden) in the constructor
- then only switch visibility or text.
When tile size is not compatible with atlas and trying to paint:
When atlas is not set: