View Single Post
  #5 (permalink)  
Old May 19th, 2007, 09:04 AM
Zulbaric Zulbaric is offline
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here are the replacements for the incorrect areas:

public static void TestMenuSprites()
        {
            StartTest(
                delegate
                {
                    testGame.RenderSprite(testGame.menuTexture,
                        new Rectangle(512-XnaPongLogoRect.Width/2, 150,
                        XnaPongLogoRect.Width, XnaPongLogoRect.Height),
                        XnaPongLogoRect);
                    testGame.RenderSprite(testGame.menuTexture,
                        new Rectangle(512-MenuSingleplayerRect.Width/2, 300,
                        MenuSingleplayerRect.Width, MenuSingleplayerRect.Height),
                        MenuSingleplayerRect);
                    testGame.RenderSprite(testGame.menuTexture,
                        new Rectangle(512-MenuMultiplayerRect.Width/2, 350,
                        MenuMultiplayerRect.Width, MenuMultiplayerRect.Height),
                        MenuMultiplayerRect, Color.Orange);
                    testGame.RenderSprite(testGame.menuTexture,
                        new Rectangle(512-MenuExitRect.Width/2, 400,
                        MenuExitRect.Width, MenuExitRect.Height),
                        MenuExitRect);
                });
        } // TestMenuSprites()




        public void RenderSprite(Texture2D texture, Rectangle rect, Rectangle? sourceRect,
            Color color)
        {
            sprites.Add(new SpriteToRender(texture, rect, sourceRect, color));
        } // RenderSprite(texture, rect, sourceRect, color)

        public void RenderSprite(Texture2D texture, Rectangle rect, Rectangle? sourceRect)
        {
            RenderSprite(texture, rect, sourceRect, Color.White);
        } // RenderSprite(texture, rect, sourceRect)

        public void RenderSprite(Texture2D texture, int x, int y, Rectangle? sourceRect,
            Color color)
        {
            RenderSprite(texture,
                new Rectangle(x, y, sourceRect.Value.Width, sourceRect.Value.Height),
                sourceRect, color);
        } // RenderSprite(texture, rect, sourceRect)

        public void RenderSprite(Texture2D texture, int x, int y, Rectangle? sourceRect)
        {
            RenderSprite(texture,
                new Rectangle(x, y, sourceRect.Value.Width, sourceRect.Value.Height),
                sourceRect, Color.White);
        } // RenderSprite(texture, rect, sourceRect)

        public void RenderSprite(Texture2D texture, Rectangle rect, Color color)
        {
            RenderSprite(texture, rect, null, color);
        } // RenderSprite(texture, rect, color)

        public void RenderSprite(Texture2D texture, Rectangle rect)
        {
            RenderSprite(texture, rect, null, Color.White);
        } // RenderSprite(texture, rect)

        public void RenderSprite(Texture2D texture)
        {
            RenderSprite(texture, new Rectangle(0, 0, 1024, 768), null, Color.White);
        } // RenderSprite(texture)