Как я могу изменить режим отображения игры моего проекта DirectX с 4: 3 на 16: 9? - PullRequest
1 голос
/ 06 ноября 2011

Как я могу изменить режим отображения игры моего проекта с 4: 3 на 16: 9?

1 Ответ

0 голосов
/ 06 ноября 2011

Вы можете создать класс и изменить метод LoadContent, чтобы увидеть этот компонент в действии.Вы просто загружаете связанный контент, создаете экземпляр HelpScene и выполняете метод Show объекта HelpScene:

public class HelpScene : GameScene
    {
        public HelpScene(Game game, Texture2D textureBack, Texture2D textureFront)
            : base(game)
        {
            Components.Add(new ImageComponent(game, textureBack,
            ImageComponent.DrawMode.Stretch));
            Components.Add(new ImageComponent(game, textureFront,
            ImageComponent.DrawMode.Center));
        }
    }
    protected override void LoadContent()
    {
        // Create a new SpriteBatch, which can be used to draw textures
        spriteBatch = new SpriteBatch(graphics.GraphicsDevice);
        Services.AddService(typeof(SpriteBatch), spriteBatch);
        // Create the Credits / Instruction scene
        helpBackgroundTexture = Content.Load<Texture2D>("helpbackground");
        helpForegroundTexture = Content.Load<Texture2D>("helpForeground");
        helpScene = new HelpScene(this, helpBackgroundTexture,
        helpForegroundTexture);
        Components.Add(helpScene);
        helpScene.Show();
        activeScene = helpScene;
    }
...