Пример #1
0
        public void Draw(SpriteBatch spriteBatch)
        {
            // Background
            if (BGTex != null)
            {
                spriteBatch.Draw(BGTex, m_GridArea.ToRect().AddVector2(DrawOffset), Color.White);
            }

            // Tiles
            Tiles.ForEach(t => t.Draw(spriteBatch, DrawOffset));
        }
Пример #2
0
        /// <summary>
        /// Draws the node visually. Only used for debug purpose.
        /// </summary>
        /// <param name="spriteBatch"></param>
        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Common.White1px, AABB.ToRect(), BGColor);

            const int LINE_WIDTH = 3;

            spriteBatch.Draw(Common.White1px, new Rectangle((int)AABB.Left, (int)AABB.Top, (int)AABB.Width, LINE_WIDTH), Color.Red);
            spriteBatch.Draw(Common.White1px, new Rectangle((int)AABB.Right - LINE_WIDTH, (int)AABB.Top, LINE_WIDTH, (int)AABB.Height), Color.Red);
            spriteBatch.Draw(Common.White1px, new Rectangle((int)AABB.Left, (int)AABB.Bottom - LINE_WIDTH, (int)AABB.Width, LINE_WIDTH), Color.Red);
            spriteBatch.Draw(Common.White1px, new Rectangle((int)AABB.Left, (int)AABB.Top, LINE_WIDTH, (int)AABB.Height), Color.Red);

            if (!IsLeaf)
            {
                TopLeft.Draw(spriteBatch);
                TopRight.Draw(spriteBatch);
                BottomRight.Draw(spriteBatch);
                BottomLeft.Draw(spriteBatch);
            }
        }