本文整理汇总了C#中Camera.CenterOnPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Camera.CenterOnPoint方法的具体用法?C# Camera.CenterOnPoint怎么用?C# Camera.CenterOnPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera
的用法示例。
在下文中一共展示了Camera.CenterOnPoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public override void Start(GameState gameState)
{
this.gameState = gameState;
SpawnPlayer (StartPoint);
camera = gameState.camera;
{
camera.Bounds = new Rectangle(0, 0, Level.Texture.Width, Level.Texture.Height);
camera.UseBounds = true;
camera.Scale = 1f;
camera.CenterOnPoint (StartPoint);
}
gameState.cloudManager = new CloudManager (camera.Bounds.Width, camera.Bounds.Height);
GameObjects.Add (Player);
var w1 = SpawnWalker (new Vector2(396, 647), Directions.Left, 100f, 115f);
var w2 = SpawnWalker (new Vector2(589, 443), Directions.Right, 100f, 110f);
var w3 = SpawnWalker (new Vector2(143, 175), Directions.Right, 100f, 100f);
var s1 = SpawnSentry (new Vector2(41, 365), Directions.Right, 1600, gameState);
w1.Speed = 150;
}
示例2: Start
public override void Start(GameState gameState)
{
this.gameState = gameState;
SpawnPlayer (StartPoint);
camera = gameState.camera;
{
camera.Bounds = new Rectangle(0, 0, Level.Texture.Width, Level.Texture.Height);
camera.UseBounds = true;
camera.Scale = 1f;
camera.CenterOnPoint (StartPoint);
}
gameState.cloudManager = new CloudManager (camera.Bounds.Width, camera.Bounds.Height);
GameObjects.Add (Player);
var w1 = SpawnWalker (new Vector2(195, 301), Directions.Left, 140f, 135f);
var w2 = SpawnWalker (new Vector2(304, 533), Directions.Right, 55f, 55f);
var s1 = SpawnSentry (new Vector2(780, 744), Directions.Left, 1800, gameState, 1.8f);
var s2 = SpawnSentry (new Vector2(30, 300), Directions.Right, 2000, gameState);
s1.Invincible = true;
w1.Speed = 150;
}
示例3: Start
public override void Start(GameState gameState)
{
this.gameState = gameState;
SpawnPlayer (StartPoint);
camera = gameState.camera;
{
camera.Bounds = new Rectangle(0, 0, Level.Texture.Width, Level.Texture.Height);
camera.UseBounds = true;
camera.Scale = 1f;
camera.CenterOnPoint (StartPoint);
}
gameState.cloudManager = new CloudManager (camera.Bounds.Width, camera.Bounds.Height);
GameObjects.Add (Player);
SpawnWalker (new Vector2(426, 750), Directions.Left, 200f, 150f);
var w2 = SpawnWalker (new Vector2(150, 539), Directions.Left, 125f, 150f);
w2.Speed = 150;
SpawnWalker (new Vector2(605, 539), Directions.Right, 200f, 160f);
SpawnWalker (new Vector2(593, 357), Directions.Right, 100f, 100f);
var music = Engine.ContentManager.Load<Song> ("Sound\\Theme");
MediaPlayer.IsRepeating = true;
MediaPlayer.Volume = 0.4f;
MediaPlayer.Play (music);
}