Why DisplayObject or Container doesn't have `anchor` property?
See original GitHub issueSometimes I need to have a container centered, while do not want to use specific width/height value.
But I find that PIXI#Container (or DisplayObject in fact) doesn’t have anchor, so how can i make it centered without width/height ?
or, is it possible to write a .setPosition(w, h) method, whose w/h ranges between 0-1 ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
C# Anchor property doesn't seem to work - Stack Overflow
For example, I have two buttons in bottom right corner of a form - they are on the form, no containers or anything...
Read more >How to dock and anchor controls - Windows Forms .NET
Anchor a control A control is anchored to an edge by setting its Anchor property to one or more values. Certain controls, such...
Read more >PIXI.Container - PixiJS API Documentation
Container is a general-purpose display object that holds children. ... Sets the default value for the container property sortableChildren .
Read more >Screen Components: Anchor Bar and Anchor Target
The Anchor Bar is set to use a Scrolling Container, but no container with the specified ID exists in the Workspace. In such...
Read more >Object Page Floorplan | SAP Fiori Design Guidelines
The object page floorplan is used to display and categorize all ... An object page with only one section doesn't have an anchor...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

“anchor” is a concept for textures only; Containers and Display Objects do not have textures so do not have this property. Instead, you can use the property “pivot”, which works on pixel values rather than percentages.
Example: https://pixijs.github.io/examples/#/basics/container-pivot.js
Done, look at https://github.com/pixijs/pixi.js/wiki/v4-Gotchas