demiculus Posted October 21, 2018 Share Posted October 21, 2018 I posted on stackoverflow cause it is the default location where I ask programming issues. I thought I'd also post here. If that goes against the rules or something I'll be happy to be notified about it. https://stackoverflow.com/questions/52916076/adding-child-to-pixi-js-sprite-distorts-childs-dimensions-location Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 21, 2018 Share Posted October 21, 2018 Its a serious issue that exists for all the time of PixiJS, it even predates pixi , it exists in Flash! The issue follows: 1. width and height props are evil. They are not first-class citizens. https://github.com/pixijs/pixi.js/wiki/v4-Gotchas#width-and-height-are-evil 2. the behaviour cant be changed because of compatibility with flash. https://github.com/pixijs/pixi.js/blob/dev/src/core/display/Container.js#L570 Look here: https://github.com/pixijs/pixi.js/blob/dev/src/core/sprites/Sprite.js#L373 . Extend Sprite class, override getLocalBounds method that way it ignores children, leave only the code inside that "if". demiculus 1 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.