Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIXI.Text cant be displayed when add to a child container #3223

Closed
gaccob opened this issue Oct 30, 2016 · 3 comments
Closed

PIXI.Text cant be displayed when add to a child container #3223

gaccob opened this issue Oct 30, 2016 · 3 comments
Labels
🤔 Question User question, similar to Help Wanted or Needs Help. These can be addressed whenever someone has tim

Comments

@gaccob
Copy link

gaccob commented Oct 30, 2016

take http://pixijs.github.io/examples/#/demos/text-demo.js for example,

I added a container named view to stage,
1

and add textSample to view,
2

then, the textSample won't be displayed, is it correct or a bug?

@themoonrat
Copy link
Member

themoonrat commented Oct 30, 2016

It's correct.. and the reason is the ordering of the children.

You see, within the init() function you have

// add a shiny background...
var background = PIXI.Sprite.fromImage('required/assets/textDemoBG.jpg');
stage.addChild(background);

This background is added after your new view container is added, and so will be drawn after anything added to your new view container.
If you move the

var view = new PIXI.Container();
stage.addChild(view)

to just before
view.addChild(textSample);
You'll see it works just fine :)

@gaccob
Copy link
Author

gaccob commented Oct 31, 2016

got it, thanks a lot.

@englercj englercj added the 🤔 Question User question, similar to Help Wanted or Needs Help. These can be addressed whenever someone has tim label Oct 31, 2016
@lock
Copy link

lock bot commented Feb 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🤔 Question User question, similar to Help Wanted or Needs Help. These can be addressed whenever someone has tim
Projects
None yet
Development

No branches or pull requests

4 participants