Pixi.js: [Question] Standardizing anchor property for all Display Objects

Created on 28 Apr 2020  ·  3Comments  ·  Source: pixijs/pixi.js

I'm not sure if this has been covered in the past, I was just looking over the API and how our team consumes it. I was wondering if any thought has been given to standardizing the anchor property across all display objects. Moving it from Sprite to DisplayObject.

It seems to be a pretty handy API that could be used for all display objects.

🙏 Feature Request

All 3 comments

That requires fixed width/height for all objects or calculated layout.

width/height are not first-class citizens in pixi, they are calculated

for sprite and maybe a few other objects width and height match texture size multiplied by scale

No width/height => no anchor.

Yes, maybe you can add overrides for width/height differently that they exist, in that case anchor makes sense. Our implementation is based on Adobe Flash experience.

If you have a team and serious project - I recommend you try write your own stage tree, v5 is almost at the point where its actually possible to do for small teams :)

Extra clarification: there are many things I want to use in pixi trees but if we put them there it will become bloated. I want better handling of transforms, color transforms, queue for changes in stage, added_to_stage , removed_from_stage events and many other things, that's why I'm pushing for changes that lead to possibility of making custom tree nodes.

Thanks for the suggestion. We’ve gotten requests like this before and unfortunately we’ve had to say “no” for the reasons Ivan articulated. I’m going to close this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

neciszhang picture neciszhang  ·  3Comments

Vardner picture Vardner  ·  3Comments

lunabunn picture lunabunn  ·  3Comments

gaccob picture gaccob  ·  3Comments

YuryKuvetski picture YuryKuvetski  ·  3Comments