1

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

4

1 回答 1

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;
    }
于 2011-11-06T02:42:46.990 回答