當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。