XNA Draw不会在Draw Routine中绘制最后一张图像

时间:2015-02-09 15:32:11

标签: c# button menu xna draw

我有一个主菜单,它不会在Draw循环中绘制最后两个按钮。我可以取出顶部的一个,它不会绘制最后一个(但绘制它上面的一个)。有人可以帮忙吗?

if (gameState == GameState.TitleScreen)
        {
            this.graphics.PreferredBackBufferWidth = 800;
            this.graphics.PreferredBackBufferHeight = 511;
            this.graphics.ApplyChanges();

            //Draw the Logo
            spriteBatch.Draw(Logo, LogoPosition, Color.White);

            //Draw the PlayButton
            spriteBatch.Draw(PlayButton, PlayButtonPosition, Color.White);

            //Draw the Options Button
            spriteBatch.Draw(OptionsButton, OptionsButtonPosition, Color.White);

            //Draw the Credits Button
            spriteBatch.Draw(CreditsButton, CreditsButtonPosition, Color.White);

            //Draw the Exit Button
            spriteBatch.Draw(ExitButton, ExitButtonPosition, Color.White);

            //Draw the Website Button
            spriteBatch.Draw(WebsiteButton, WebsiteButtonPosition, Color.White);

            //Draw Background
            TreeBackground.Draw(spriteBatch);
            TreeBackground2.Draw(spriteBatch);
        }

这些按钮的位置包括在这里:

//Positions
        PlayButtonPosition = new Vector2((GraphicsDevice.Viewport.Width / 2) - 50, 200);
        OptionsButtonPosition = new Vector2((GraphicsDevice.Viewport.Width / 2) - 50, 250);
        CreditsButtonPosition = new Vector2((GraphicsDevice.Viewport.Width / 2) - 50, 300);
        ExitButtonPosition = new Vector2((GraphicsDevice.Viewport.Width / 2) - 50, 350);
        WebsiteButtonPosition = new Vector2((GraphicsDevice.Viewport.Width / 2) - -400, 0);

0 个答案:

没有答案