I’m creating a Bomberman Game with different Components. I’ve created separate DrawableGameComponents for BombList, PlayerList, WallList, PlayerDisplay (List of players when TAB is pressed) and added them in the Components list. The backboard and instruction texts are drawn in the main Game1 class.
I want to know in what order these Components are rendered. Is it in the order in which they are in Components List? Initially it seemed like that.
Later, I needed to update BombList, PlayerList and WallList. But this time, it was rendering PlayersDisplay at the back. I tried to insert them at different positions but I realized what matters is the order in which the Components are added (no matter at what position).
My questions are
- In what order are the Components rendered in
Componentslist? - If I’ve many Components, then when will the
Draw()of theGame1class be called with respect to other Components in the list? - Has this
Gameclass been added in theComponentslist in the base constructor?
Reading up on the documentation explains that.
It has the following member:
.DrawOrderAdditionally, when you call
base.Draw()in yourDrawoverride you’re calling the.Drawmethod for all components.