예제 #1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            // TODO: Add your drawing code here
            spriteBatch.Begin();

            // Background
            spriteBatch.Draw(m_background, m_rect, Color.White);

            // Decks
            for (int di = 0; di < m_deckList.Count; di++)
            {
                Deck d = m_deckList[di];
                d.Draw(this.spriteBatch);
            }

            // Active card
            if (p_activeCard != null)
            {
                // Draw active card and all its parent cards
                // on top of other cards
                p_activeCard.DrawMeAndParent(this.spriteBatch);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }
예제 #2
0
 /// <summary>
 /// Draw this card and all parents cards
 /// </summary>
 /// <param name="theSpriteBatch"></param>
 public void DrawMeAndParent(SpriteBatch theSpriteBatch)
 {
     // Me
     this.Draw(theSpriteBatch);
     // And parent to top of Me
     if (p_parentCard != null)
     {
         p_parentCard.DrawMeAndParent(theSpriteBatch);
     }
 }