本文整理匯總了C#中Camera2D.SetSceneBounds方法的典型用法代碼示例。如果您正苦於以下問題:C# Camera2D.SetSceneBounds方法的具體用法?C# Camera2D.SetSceneBounds怎麽用?C# Camera2D.SetSceneBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Camera2D
的用法示例。
在下文中一共展示了Camera2D.SetSceneBounds方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Initialize
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
graphics.PreferredBackBufferWidth = graphics.GraphicsDevice.DisplayMode.Width;
graphics.PreferredBackBufferHeight = graphics.GraphicsDevice.DisplayMode.Height;
graphics.ApplyChanges();
//Engine.LevelBounds = new Rectangle(0, 0, graphics.GraphicsDevice.Viewport.Width * 2, graphics.GraphicsDevice.Viewport.Height);
base.Initialize();
Engine.InitializeLevel("Level1");
player = Engine.InitializePlayer();
Engine.InitializeEnemies();
Engine.InitializeObjects();
Engine.InitializeUpdatableObjects();
Engine.InitializeItems();
camera = new Camera2D(graphics.GraphicsDevice);
camera.SetSceneBounds(new Rectangle(50, 50, Engine.LevelBounds.Width - 200, Engine.LevelBounds.Height));
camera.SetChaseTarget(player);
debug = new MidoriDebug(Content, spriteBatch);
gameOver = false;
player.PlayerIsDead += (sender, evArgs) => { gameOver = true; };
}