Jump to content

Container Height?


dazzafact
 Share

Recommended Posts

Container bounds contain all the children. Height of container is height of its local bounds. When you change the height, "scale.y" changes instead.

https://github.com/pixijs/pixi.js/blob/dev/src/core/display/Container.js#L601

That's the same logic Adobe Flash had. To override it you have to extend Container class and override width/height properties, either calculateBounds() method, make it ignore children (https://github.com/pixijs/pixi.js/blob/dev/src/core/display/Container.js#L343)

Pixi doesnt have container with fixed bounds in the package. Logic for sprite is a bit different: https://github.com/pixijs/pixi.js/blob/dev/src/core/sprites/Sprite.js#L537, it changes scale based on texture height and not bounds of children.

Link to comment
Share on other sites

  • 2 months later...

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