如何将DirectX项目游戏的显示模式从4:3更改为16:9?

时间:2011-11-06 02:28:04

标签: directx directx-9

如何将项目游戏的显示模式从4:3更改为16:9?

1 个答案:

答案 0 :(得分:0)

您可以创建一个类并更改LoadContent方法以查看此组件的运行情况。您只需加载相关内容,创建HelpScene实例,然后执行HelpScene对象的Show方法:

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;
    }