Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

When manually setting the drawing order of game components by setting

int DrawableGameComponent.DrawOrder

can one use any integer numbers as long an order is defined like

  • component1 => drawing order: 2
  • component2 => drawing order: 5
  • component3 => drawing order: 10
  • component4 => drawing order: 323

or do these integers have to be consecutive and starting with zero like

  • component1 => drawing order: 0
  • component2 => drawing order: 1
  • component3 => drawing order: 2
  • component4 => drawing order: 3

?

share|improve this question

1 Answer 1

It can be anything

This value can be any integer. Components in the GameComponentCollection are drawn in ascending order based on their DrawOrder.

http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.drawablegamecomponent.draworder.aspx

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.