1
好吧,我有一個Scene
類基本上是這樣的:如何在沒有GraphicsDevice的情況下調整xna窗口大小?
public class Scene : DrawableGameComponent
{
public List<GameComponent> SceneComponents { get; set; }
public Scene(Game game)
: base(game)
{
SceneComponents = new List<GameComponent>();
}
然後得到了我的Scene1
類,看起來像這樣:
public class Scene1 : Scene
{
private SpriteBatch spriteBatch;
private Game game;
public Scene1(Game game) : base(game)
{
this.game = game;
spriteBatch = (SpriteBatch)game.Services.GetService(typeof(SpriteBatch));
}
}
而且我得到了Game1
類看起來像這樣:
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Scene1 scene1;
//Scene2 scene2;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
}
現在顯然他們比這大得多,但我只想要signa圖和擴展。
所有的遊戲都在運行場景....場景類別無關緊要。
我在Scene1
上工作,並希望將屏幕分辨率更改爲500x500任何想法我怎麼做?