当前位置: 首页>>代码示例>>C#>>正文


C# Camera.CenterOnPoint方法代码示例

本文整理汇总了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;
        }
开发者ID:NullSoldier,项目名称:ProjectBirthday,代码行数:25,代码来源:LevelTwo.cs

示例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;
        }
开发者ID:NullSoldier,项目名称:ProjectBirthday,代码行数:26,代码来源:LevelThree.cs

示例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);
        }
开发者ID:NullSoldier,项目名称:ProjectBirthday,代码行数:29,代码来源:LevelOne.cs


注:本文中的Camera.CenterOnPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。