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



It can be anything

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



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.