コード例 #1
0
ファイル: Main.cs プロジェクト: hcxyzlm/CocosNet-1
        public override void FinishedLaunching(UIApplication app)
        {
            // all images are found in the Images directory,
            // so all images can now be loaded by just their name, not "Images\foo.png"
            TextureMgr.Instance.ImageRoot = "Images";

            window.BackgroundColor = UIColor.Red;

            window.UserInteractionEnabled = true;
            window.MultipleTouchEnabled = false;
            window.Bounds = new System.Drawing.RectangleF(0, 0, 768, 1024);

            Director.Instance.DeviceOrientation = DeviceOrientation.Portrait;
            Director.Instance.AnimationInterval = 1.0 / 60.0;
            Director.Instance.IsDisplayFPS = true;

            Director.Instance.AttachInView(window);

            window.MakeKeyAndVisible();

            // To run a different test, instantiate a different class here
            // SpriteTest -- SpriteManual
            // ParallaxTest -- Parallax1
            // ParticleTest -- DemoFirework
            // PrimitivesTest -- HorizontalDrawPrimitives
            Scene scene = new Scene(new DemoFirework());

            Director.Instance.RunScene(scene);
        }
コード例 #2
0
ファイル: TransitionScene.cs プロジェクト: hcxyzlm/CocosNet-1
        protected TransitionScene(float duration, Scene inScene)
        {
            if (duration < 0) {
                throw new ArgumentException("duration must be positive", "duration");
            }

            if (inScene == null) {
                throw new ArgumentNullException("inScene");
            }

            _inScene = inScene;
            _inScene.Visible = true;

            _outScene = Director.Instance.RunningScene;

            if (ReferenceEquals(_inScene, _outScene)) {
                throw new InvalidOperationException("TransitionScene: the in and out scenes must be different");
            }

            TouchDispatcher.Instance.DispatchEvents = false;

            SetSceneOrder();
        }
コード例 #3
0
ファイル: Director.cs プロジェクト: ishinao/CocosNet
		public void PushScene(Scene scene) {
			if (scene == null) {
				throw new ArgumentNullException("scene");
			}
			
			_sceneStack.Push(scene);
			_nextScene.Target = scene;
		}
コード例 #4
0
ファイル: Director.cs プロジェクト: ishinao/CocosNet
		public void RunScene(Scene scene) {
			if (scene == null) {
				throw new ArgumentNullException("scene");
			}
			
			if (RunningScene != null) {
				throw new InvalidOperationException("You can't run a scene if another Scene is running. Use ReplaceScene or PushScene instead");
			}
			
			PushScene(scene);
			StartAnimation();
		}
コード例 #5
0
ファイル: TransitionScene.cs プロジェクト: hcxyzlm/CocosNet-1
 public MoveInLeftTransition(float duration, Scene inScene)
     : base(duration, inScene)
 {
 }