コード例 #1
0
 /// <summary>
 /// Allows the game component to perform any initialization it needs to before starting
 /// to run.  This is where it can query for any required services and load content.
 /// </summary>
 public override void Initialize()
 {
     watch        = (XnaWatch)Game.Services.GetService(typeof(XnaWatch));
     random       = (Random)Game.Services.GetService(typeof(Random));
     device       = Game.GraphicsDevice;
     HeightOfGame = device.PresentationParameters.BackBufferHeight;
     WidthOfGame  = device.PresentationParameters.BackBufferWidth;
     base.Initialize();
 }
コード例 #2
0
 /// <summary>
 /// Allows the game component to perform any initialization it needs to before starting
 /// to run.  This is where it can query for any required services and load content.
 /// </summary>
 public override void Initialize()
 {
     watch = (XnaWatch)Game.Services.GetService(typeof(XnaWatch));
     random = (Random)Game.Services.GetService(typeof(Random));
     device = Game.GraphicsDevice;
     HeightOfGame = device.PresentationParameters.BackBufferHeight;
     WidthOfGame = device.PresentationParameters.BackBufferWidth;
     base.Initialize();
 }