0
\$\begingroup\$

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

?

\$\endgroup\$
5
\$\begingroup\$

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

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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