Jump to content

Draw Debug Geometry Below Sprites


MadMonkey119
 Share

Recommended Posts

Hi, I introduced myself to Phaser yesterday and have been having fun learning and playing with it. I am currently drawing a rectangle to use for a game's background.

 

To draw it I first create the rectangle 

new Phaser.Rectangle(0, 0, 480, 0)

then use

 game.debug.geom()

I want to now display a sprite above the rectangle background but I can't find a way to influence the order in which they are drawn.

 

Thank you very much!

Link to comment
Share on other sites

I have solved my own problem by using graphics rather than drawing debug geometry. Graphics can be used to draw rectangles, circles, etc so it was a much better implementation than debug geometry.

 

By calling

graphics = game.add.graphics(0, 0);

before adding my sprites to the screen it draws the graphics below the sprites.

Link to comment
Share on other sites

  • 2 weeks later...
 Share

  • Recently Browsing   0 members

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