Jump to content

sendToBack not working?


eddieone
 Share

Recommended Posts

So I have a pineapple sprite I want behind the player. When I use sendToBack, it doesn't seem to do anything. What am I missing?

this.pineapple = game.make.sprite(0, 0, 'pineapple');
this.pineapple.anchor.set(0.5);
this.pineapple.x = 0;
this.pineapple.y =  - 60;
this.sprite.addChild(this.pineapple);
this.pineapple.sendToBack();

 

I also tried addChildAt(sprite, 0) though no luck

pineapple.jpg

Link to comment
Share on other sites

You are right. It is working but since my panda is also the parent it won't display behind that. If I understand correctly, groups don't work well with Box2D unless they're never moved. I will try to use a display object and render my panda as a child. Maybe setup my own layers, so I don't have to fuss with moving stuff once I start stacking a bunch of sprites. Thanks Rich

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...