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 に答える