Jump to content

Adding child to sprite distorts childs dimensions & location.


demiculus
 Share

Recommended Posts

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".

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...