Sign in to follow this  
dazzafact

Container Height?

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.