public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            application.PreferMultiSampling = false;
            application.ContentRootDirectory = "Content";
            application.ContentSearchPaths.Add ("animations");
            application.ContentSearchPaths.Add ("fonts");
            application.ContentSearchPaths.Add ("sounds");

            CCSize windowSize = mainWindow.WindowSizeInPixels;

            float desiredHeight = 512.0f;
            float desiredWidth = 384.0f;

            // This will set the world bounds to be (0,0, w, h).
            // CCSceneResolutionPolicy.ShowAll will ensure that the aspect ratio is preserved.
            CCScene.SetDefaultDesignResolution (desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);

            // Determine whether to use the high or low def versions of our images.
            // Make sure the default texel to content size ratio is set correctly.
            // Of course you're free to have a finer set of image resolutions e.g (ld, hd, super-hd).
            if (desiredWidth < windowSize.Width) {
                application.ContentSearchPaths.Add ("images/hd");
                CCSprite.DefaultTexelToContentSizeRatio = 2.0f;
            } else {
                application.ContentSearchPaths.Add ("images/ld");
                CCSprite.DefaultTexelToContentSizeRatio = 1.0f;
            }

            CCScene scene = new CCScene (mainWindow);
            GameLayer gameLayer = new GameLayer ();

            scene.AddChild (gameLayer);

            mainWindow.RunWithScene (scene);
        }
Example #2
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            application.ContentRootDirectory = "Content";
            var windowSize = mainWindow.WindowSizeInPixels;

            var desiredWidth = 1024.0f;
            var desiredHeight = 768.0f;
            
            // This will set the world bounds to be (0,0, w, h)
            // CCSceneResolutionPolicy.ShowAll will ensure that the aspect ratio is preserved
            mainWindow.SetDesignResolutionSize(desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);
            
            // Determine whether to use the high or low def versions of our images
            // Make sure the default texel to content size ratio is set correctly
            // Of course you're free to have a finer set of image resolutions e.g (ld, hd, super-hd)
            if (desiredWidth < windowSize.Width)
            {
                application.ContentSearchPaths.Add("hd");
                CCSprite.DefaultTexelToContentSizeRatio = 2.0f;
            }
            else
            {
                application.ContentSearchPaths.Add("ld");
                CCSprite.DefaultTexelToContentSizeRatio = 1.0f;
            }
            
            var scene = new CCScene(mainWindow);
            var introLayer = new IntroLayer();

            scene.AddChild(introLayer);

            mainWindow.RunWithScene(scene);
        }
Example #3
0
		public override void ApplicationDidFinishLaunching (CCApplication application, CCWindow mainWindow)
		{
			application.PreferMultiSampling = false;
			application.ContentRootDirectory = "Content";
			application.ContentSearchPaths.Add ("animations");
			application.ContentSearchPaths.Add ("fonts");
			application.ContentSearchPaths.Add ("sounds");

			CCSize windowSize = mainWindow.WindowSizeInPixels;

			float desiredHeight = 1024.0f;
			float desiredWidth = 768.0f;
    
			// This will set the world bounds to be (0,0, w, h)
			// CCSceneResolutionPolicy.ShowAll will ensure that the aspect ratio is preserved
			CCScene.SetDefaultDesignResolution (desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);
            
           
			CCScene scene = new CCScene (mainWindow);
			GameLayer gameLayer = new GameLayer ();

			scene.AddChild (gameLayer);

			mainWindow.RunWithScene (scene);
		}
Example #4
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            application.PreferMultiSampling = false;
            application.ContentRootDirectory = "Content";
            application.ContentSearchPaths.Add ("fonts");
            application.ContentSearchPaths.Add ("landscape");
            application.ContentSearchPaths.Add ("menu");
            application.ContentSearchPaths.Add ("interface");
            application.ContentSearchPaths.Add ("particle");

            gameContainer = new mapKnightLibrary.Container ();
            gameContainer.mainCharacter= new RoboBob();
            gameContainer.physicsHandler = new PhysicsHandler ();

            runningWindow = mainWindow;
            // This tells the application to not use antialiasing which can
            // improve the performance of your game.

            // Get the resolution of the main window...
            var bounds = mainWindow.WindowSizeInPixels;

            ////definieren der Windowgröße auf 1280x576 p (16:9)
            CCScene.SetDefaultDesignResolution (bounds.Width, bounds.Height, CCSceneResolutionPolicy.ShowAll);

            //startScene = new StartScene (mainWindow);
            gameScene = new GameScene (mainWindow, gameContainer, RunningControlType);
            optionScene = new OptionScene (mainWindow);

            // startet das erste Fenster
            mainWindow.RunWithScene (gameScene);
            //startScene.Version = app_version;
            //startScene.startGame += startGame;
            //if (ApplicationFinishedLaunching != null)
            //	ApplicationFinishedLaunching (this, EventArgs.Empty);
        }
Example #5
0
        /// <summary>
        /// Called when app launched.
        /// </summary>
        /// <param name="application">application object</param>
        /// <param name="mainWindow">main window</param>
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            application.PreferMultiSampling = false;

            application.ContentRootDirectory = "Content";
            var windowSize = mainWindow.WindowSizeInPixels;

            var desiredHeight = 1024.0f;
            var desiredWidth = 768.0f;

            // This will set the world bounds to be (0,0, w, h)
            // CCSceneResolutionPolicy.ShowAll will ensure that the aspect ratio is preserved
            CCScene.SetDefaultDesignResolution(desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);

            CCSimpleAudioEngine.SharedEngine.PreloadEffect("sounds/hit_paddle");
            CCSimpleAudioEngine.SharedEngine.PreloadEffect("sounds/hit_wall");
            CCSimpleAudioEngine.SharedEngine.PreloadEffect("sounds/hit_off");

            var scene = new CCScene(mainWindow);
            var introLayer = new IntroLayer();

            scene.AddChild(introLayer);

            mainWindow.RunWithScene(scene);
        }
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {

            CCLog.Logger = DebugLogging;

            preferredWidth = 1024;
			preferredHeight = 768;

			application.PreferMultiSampling = true;
			application.ContentRootDirectory = "Content";

			//CCSpriteFontCache.FontScale = 0.5f;
			//CCSpriteFontCache.RegisterFont("MarkerFelt", 22);
			//CCSpriteFontCache.RegisterFont("arial", 12, 24);

			CCSize designSize = new CCSize(480, 320);

//			if (CCDrawManager.FrameSize.Height > 320)
//			{
//				//CCSize resourceSize = new CCSize(960, 640);
//				CCSize resourceSize = new CCSize(480, 320);
//				application.ContentSearchPaths.Add("hd");
//				director.ContentScaleFactor = resourceSize.Height / designSize.Height;
//			}

            CCScene.SetDefaultDesignResolution(designSize.Width, designSize.Height, CCSceneResolutionPolicy.ShowAll);

			// turn on display FPS
			mainWindow.DisplayStats = true;
            mainWindow.StatsScale = 2;

            CCScene pScene = GoblinLayer.Scene(mainWindow);

			mainWindow.RunWithScene(pScene);
		}
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            application.PreferMultiSampling = false;
            application.ContentRootDirectory = "Content";

            try
            {
                CCSimpleAudioEngine.SharedEngine.PreloadEffect("Sounds/SplatEffect");
                CCSimpleAudioEngine.SharedEngine.PreloadEffect("Sounds/pew-pew-lei");
                CCSimpleAudioEngine.SharedEngine.PlayBackgroundMusic("Sounds/backgroundSound", true);
                CCSimpleAudioEngine.SharedEngine.BackgroundMusicVolume = 0.9f;
                CCSimpleAudioEngine.SharedEngine.EffectsVolume = 0.7f;
            }
            catch(Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }

            var winSize = mainWindow.WindowSizeInPixels;
            mainWindow.SetDesignResolutionSize(winSize.Width, winSize.Height, CCSceneResolutionPolicy.ExactFit);
            //			CCScene.SetDefaultDesignResolution(winSize.Width, winSize.Height, CCSceneResolutionPolicy.ExactFit);

            // TODO: Set this up when we have a Game Layer
            CCScene scene = GameStartLayer.GameStartLayerScene(mainWindow);
            mainWindow.RunWithScene (scene);
        }
Example #8
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            application.ContentRootDirectory = "Content";

            sharedWindow = mainWindow;

    	    var introScene = IntroLayer.CreateScene(mainWindow);
            sharedWindow.RunWithScene(introScene);
        }
Example #9
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            SharedWindow = mainWindow;

            DefaultResolution = new CCSize(
                application.MainWindow.WindowSizeInPixels.Width,
                application.MainWindow.WindowSizeInPixels.Height);

            application.ContentRootDirectory = "Content";

            CCScene scene = new CCScene(mainWindow);
            CCLayer layer = new IntroLayer(DefaultResolution);

            var b = new CozyColorSampleButton(100, 100, 158, 158)
            {
                NormalColor     = new CCColor4B(255, 0, 0),
                ClickedColor    = new CCColor4B(0, 255, 0),
                Text            = "Hello Bttton",
                HasBorder       = true,
            };

            b.OnClick += () =>
            {
            };

            var list = new CozySampleListView()
            {
                ContentSize = new CCSize(350, 350),
                Orientation = ControlOrientation.Vertical,
                Position    = new CCPoint(100, 100),
                HasBorder   = true,
            };
            layer.AddChild(list);

            list.AddItem(new CozySampleListViewItemSprite(new CCSprite("gold"))

            {
                MarginBottom    = 10,
                MarginTop       = 10,
                HasBorder       = true,
            });
            list.AddItem(b);
            list.AddItem(new CozySampleListViewItemSprite(new CCSprite("gold"))

            {
                MarginBottom    = 10,
                MarginTop       = 10,
                HasBorder       = true,
            });

            layer.AddEventListener(b.EventListener, layer);

            scene.AddChild(layer);
            mainWindow.RunWithScene(scene);
        }
		public override void ApplicationDidFinishLaunching (CCApplication application, CCWindow mainWindow)
		{
			application.PreferMultiSampling = false;
			application.ContentRootDirectory = "Content";

			var bounds = mainWindow.WindowSizeInPixels;
			CCScene.SetDefaultDesignResolution(bounds.Width, bounds.Height, CCSceneResolutionPolicy.ShowAll);

			GameScene gameScene = new GameScene (mainWindow);
			mainWindow.RunWithScene (gameScene);
		}
Example #11
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) {
            base.ApplicationDidFinishLaunching(application, mainWindow);

            /** Set up resource folders */
            Resources.LoadContent(application);

            ServerScene = new ServerScene(mainWindow);
            mainWindow.RunWithScene(ServerScene);
            LoadAccounts();

            ServerScene.Schedule(SaveAccounts, 5);
        }
Example #12
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {

            //application.AllowUserResizing = true;
            application.PreferMultiSampling = false;
            application.ContentRootDirectory = "Content";

            application.ContentSearchResolutionOrder = new List<string>() { "", "images", "fonts" };

            sharedWindow = mainWindow;

            CCSize winSize = mainWindow.WindowSizeInPixels;
            CCScene.SetDefaultDesignResolution(winSize.Width, winSize.Height, CCSceneResolutionPolicy.ShowAll);
            //CCScene.SetDefaultDesignResolution(winSize.Width/2, winSize.Height/2, CCSceneResolutionPolicy.ShowAll);


            #if WINDOWS || WINDOWSGL || WINDOWSDX 
            //application.PreferredBackBufferWidth = 1024;
            //application.PreferredBackBufferHeight = 768;
            #elif MACOS
            //application.PreferredBackBufferWidth = 960;
            //application.PreferredBackBufferHeight = 640;
            #endif

            #if WINDOWS_PHONE8
            application.HandleMediaStateAutomatically = false; // Bug in MonoGame - https://github.com/Cocos2DXNA/cocos2d-xna/issues/325
            #endif

            //CCSpriteFontCache.FontScale = 0.6f;
            CCSpriteFontCache.RegisterFont("arial", 12, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 38, 50, 64);
            CCSpriteFontCache.RegisterFont("MarkerFelt", 16, 18, 22, 32);
            CCSpriteFontCache.RegisterFont("MarkerFelt-Thin", 12, 18);
            CCSpriteFontCache.RegisterFont("Paint Boy", 26);
            CCSpriteFontCache.RegisterFont("Schwarzwald Regular", 26);
            CCSpriteFontCache.RegisterFont("Scissor Cuts", 26);
            CCSpriteFontCache.RegisterFont("A Damn Mess", 26);
            CCSpriteFontCache.RegisterFont("Abberancy", 26);
            CCSpriteFontCache.RegisterFont("Abduction", 26);

            mainWindow.DisplayStats = true;
            mainWindow.StatsScale = 1;

            //            if (mainWindow.WindowSizeInPixels.Height > 320)
            //            {
            //                application.ContentSearchPaths.Insert(0,"HD");
            //            }
            //CCApplication.DefaultTexelToContentSizeRatio = 2f;
            CCScene scene = new CCScene(sharedWindow);
            CCLayer layer = new TestController();

            scene.AddChild(layer);
            sharedWindow.RunWithScene(scene);
        }
Example #13
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            //application.SupportedOrientations = CCDisplayOrientation.LandscapeRight | CCDisplayOrientation.LandscapeLeft;
            //application.AllowUserResizing = true;
            //application.PreferMultiSampling = false;
            application.ContentRootDirectory = "Content";

            sharedWindow = mainWindow;

            mainWindow.SetDesignResolutionSize(960, 640, CCSceneResolutionPolicy.ShowAll);

            #if WINDOWS || WINDOWSGL || WINDOWSDX 
			//application.PreferredBackBufferWidth = 1024;
			//application.PreferredBackBufferHeight = 768;
            #elif MACOS
            //application.PreferredBackBufferWidth = 960;
            //application.PreferredBackBufferHeight = 640;
            #endif

            #if WINDOWS_PHONE8
            application.HandleMediaStateAutomatically = false; // Bug in MonoGame - https://github.com/Cocos2DXNA/cocos2d-xna/issues/325
            #endif

            CCSpriteFontCache.FontScale = 0.6f;
            CCSpriteFontCache.RegisterFont("arial", 12, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 38, 50, 64);
            CCSpriteFontCache.RegisterFont("MarkerFelt", 16, 18, 22, 32);
            CCSpriteFontCache.RegisterFont("MarkerFelt-Thin", 12, 18);
            CCSpriteFontCache.RegisterFont("Paint Boy", 26);
            CCSpriteFontCache.RegisterFont("Schwarzwald Regular", 26);
            CCSpriteFontCache.RegisterFont("Scissor Cuts", 26);
            CCSpriteFontCache.RegisterFont("A Damn Mess", 26);
            CCSpriteFontCache.RegisterFont("Abberancy", 26);
            CCSpriteFontCache.RegisterFont("Abduction", 26);

            //sharedDirector = new CCDirector();
            //director.DisplayStats = true;
            //director.AnimationInterval = 1.0 / 60;


//            if (sharedWindow.WindowSizeInPixels.Height > 320)
//            {
//                application.ContentSearchPaths.Insert(0,"HD");
//            }

            //sharedWindow.AddSceneDirector(sharedDirector);

            CCScene scene = new CCScene(sharedWindow);
            CCLayer layer = new TestController();

            scene.AddChild(layer);
            sharedWindow.RunWithScene(scene);
        }
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            application.PreferMultiSampling = false;
            application.ContentRootDirectory = "Content";

            mainWindow.SupportedDisplayOrientations = CCDisplayOrientation.Portrait | CCDisplayOrientation.LandscapeLeft | CCDisplayOrientation.LandscapeRight;

            application.ContentSearchPaths.Add ("hd");

            CCSimpleAudioEngine.SharedEngine.PreloadEffect ("Sounds/tap");

            CCScene scene = GameStartLayer.GameStartLayerScene (mainWindow);
            mainWindow.RunWithScene (scene);
        }
Example #15
0
        /// <summary>
        ///     Метод вызывается после загрузки приложения
        /// </summary>
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) {
            base.ApplicationDidFinishLaunching(application, mainWindow);
            sharedWindow = mainWindow;

            mainWindow.SetDesignResolutionSize(Settings.ScreenWidth, Settings.ScreenHeight,
                CCSceneResolutionPolicy.ShowAll);

            Resources.LoadContent(application);
            mainWindow.DisplayStats = true;
            mainWindow.AllowUserResizing = false;


            _startScene = new MenuScene(mainWindow);
            mainWindow.RunWithScene(_startScene);
        }
        public override void ApplicationDidFinishLaunching (CCApplication application, CCWindow mainWindow)
        {
            application.PreferMultiSampling = false;
            application.ContentRootDirectory = "Content";

            application.ContentSearchPaths.Add("hd");

            CCSimpleAudioEngine.SharedEngine.PreloadEffect ("Sounds/tap");
            CCSimpleAudioEngine.SharedEngine.PreloadBackgroundMusic ("Sounds/backgroundMusic");
            CCSize winSize = mainWindow.WindowSizeInPixels;
            CCScene.SetDefaultDesignResolution(winSize.Width, winSize.Height, CCSceneResolutionPolicy.ExactFit);

            CCScene scene = GameStartLayer.GameStartLayerScene(mainWindow);
            mainWindow.RunWithScene (scene);
        }
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            application.ContentRootDirectory = "Content";
            sharedWindow = mainWindow;
            DefaultResolution = new CCSize(
            application.MainWindow.WindowSizeInPixels.Width,
            application.MainWindow.WindowSizeInPixels.Height);

            //mainWindow.SetDesignResolutionSize(960, 640, CCSceneResolutionPolicy.ShowAll);
            //application.HandleMediaStateAutomatically = false;
            //mainWindow.DisplayStats = true;

            CCScene scene =  GoblinLayer.Scene;
            sharedWindow.RunWithScene(scene);
        }
		public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
		{
			application.ContentRootDirectory = "Content";

			sharedWindow = mainWindow;

			DefaultResolution = new CCSize(
		application.MainWindow.WindowSizeInPixels.Width,
		application.MainWindow.WindowSizeInPixels.Height);

			CCScene scene = new CCScene(sharedWindow);
			CCLayer layer = new IntroLayer(DefaultResolution);

			scene.AddChild(layer);
			sharedWindow.RunWithScene(scene);
		}
		/// <summary>
		///  Implement CCDirector and CCScene init code here.
		/// </summary>
		/// <returns>
		///  true  Initialize success, app continue.
		///  false Initialize failed, app terminate.
		/// </returns>
		public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
		{

			preferredWidth = application.MainWindow.WindowSizeInPixels.Width;
			preferredHeight = application.MainWindow.WindowSizeInPixels.Height;

			application.ContentRootDirectory = "Content";
			application.ContentSearchPaths.Add("SD");

			CCScene scene = new CCScene(mainWindow);
			CCLayer layer = new IntroLayer(new CCSize(preferredWidth, preferredHeight));

			scene.AddChild(layer);

			mainWindow.RunWithScene(scene);

		}
Example #20
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            SharedWindow = mainWindow;

            DefaultResolution = new CCSize(
                application.MainWindow.WindowSizeInPixels.Width,
                application.MainWindow.WindowSizeInPixels.Height);

            application.ContentRootDirectory = "Content";

            ModuleManager.Instance.Init();
            InitNetwork();
            
            SharedClient.Connect("127.0.0.1", 44360);

            CCScene scene = new LoginScene();
            mainWindow.RunWithScene(scene);
        }
Example #21
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            Window = mainWindow;

            //application.AllowUserResizing = true;
            application.PreferMultiSampling = false;
            application.ContentRootDirectory = "Content";
            application.ContentSearchPaths.Add ("animations");
            application.ContentSearchPaths.Add ("fonts");
            application.ContentSearchPaths.Add ("images");
            application.ContentSearchPaths.Add ("sounds");

            CCSize windowSize = mainWindow.WindowSizeInPixels;
            mainWindow.SetDesignResolutionSize (windowSize.Width, windowSize.Height, CCSceneResolutionPolicy.ShowAll);

            CCScene scene = StartLevelLayer.Scene;

            mainWindow.RunWithScene (scene);
        }
Example #22
0
        /// <summary>
        ///  Implement CCDirector and CCScene init code here.
        /// </summary>
        /// <returns>
        ///  true  Initialize success, app continue.
        ///  false Initialize failed, app terminate.
        /// </returns>
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            SharedWindow = mainWindow;

            DefaultResolution = new CCSize(
                application.MainWindow.WindowSizeInPixels.Width,
                application.MainWindow.WindowSizeInPixels.Height);

            application.ContentRootDirectory = "Content";
            application.ContentSearchPaths.Add("SD");

            CCScene scene = new CCScene(mainWindow,true);
            CCLayer layer = new IntroLayer("bike.json",DefaultResolution);
            scene.AddChild(layer);

            layer.Scene.PhysicsWorld.DebugDrawMask = CCPhysicsWorld.DEBUGDRAW_SHAPE;

            mainWindow.RunWithScene(scene);
        }
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            application.PreferMultiSampling = false;
            application.ContentRootDirectory = "Content";
            application.ContentSearchPaths.Add ("animations");
            application.ContentSearchPaths.Add ("fonts");
            application.ContentSearchPaths.Add ("sounds");

            CCSize winSize = mainWindow.WindowSizeInPixels;
            CCScene.SetDefaultDesignResolution (winSize.Width, winSize.Height, CCSceneResolutionPolicy.ShowAll);

            CCScene scene = new CCScene (mainWindow);

            BouncingGame.GameLayer gameLayer = new BouncingGame.GameLayer (winSize,CCClipMode.None);

            scene.AddChild (gameLayer);

            mainWindow.RunWithScene (scene);
        }
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            application.ContentRootDirectory = "Content";
            var windowSize = mainWindow.WindowSizeInPixels;

            var desiredWidth = 1024.0f;
            var desiredHeight = 768.0f;

            // This will set the world bounds to be (0,0, w, h)
            // CCSceneResolutionPolicy.ShowAll will ensure that the aspect ratio is preserved
            CCScene.SetDefaultDesignResolution(desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);

            // Determine whether to use the high or low def versions of our images
            // Make sure the default texel to content size ratio is set correctly
            // Of course you're free to have a finer set of image resolutions e.g (ld, hd, super-hd)
            if (desiredWidth < windowSize.Width)
            {
                application.ContentSearchPaths.Add("hd");
            }
            else
            {
                application.ContentSearchPaths.Add("ld");
            }

            CCSprite.DefaultTexelToContentSizeRatio = 1.0f;

            var scene = new CCScene(mainWindow);
            var introLayer = new IntroLayer();

            mainWindow.DisplayStats = true;

            #if ANDROID
            var display = Game.Activity.WindowManager.DefaultDisplay;
            var metrics = new Android.Util.DisplayMetrics();
            display.GetMetrics(metrics);
            mainWindow.StatsScale = (int)metrics.ScaledDensity ;
            #endif

            scene.AddChild(introLayer);

            mainWindow.RunWithScene(scene);
        }
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {

#if DEBUG
            // Example of using a custom log action as a Lambda.
            CCLog.Logger = (format, args) =>
            {
                System.Diagnostics.Debug.WriteLine("TextField: " + format, args);
            };
#endif

            application.ContentRootDirectory = "Content";
            var windowSize = mainWindow.WindowSizeInPixels;

            var desiredWidth = 1024.0f;
            var desiredHeight = 768.0f;

            // This will set the world bounds to be (0,0, w, h)
            // CCSceneResolutionPolicy.ShowAll will ensure that the aspect ratio is preserved
            CCScene.SetDefaultDesignResolution(desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);

            // Determine whether to use the high or low def versions of our images
            // Make sure the default texel to content size ratio is set correctly
            // Of course you're free to have a finer set of image resolutions e.g (ld, hd, super-hd)
            if (desiredWidth < windowSize.Width)
            {
                application.ContentSearchPaths.Add("hd");
                CCSprite.DefaultTexelToContentSizeRatio = 2.0f;
            }
            else
            {
                application.ContentSearchPaths.Add("ld");
                CCSprite.DefaultTexelToContentSizeRatio = 1.0f;
            }

            var scene = new CCScene(mainWindow);
            var introLayer = new IntroLayer();

            scene.AddChild(introLayer);

            mainWindow.RunWithScene(scene);
        }
Example #26
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            application.PreferMultiSampling = false;
            application.ContentRootDirectory = "Content";

            mainWindow.SupportedDisplayOrientations = CCDisplayOrientation.Portrait;
            mainWindow.SetDesignResolutionSize(320, 480, CCSceneResolutionPolicy.ShowAll);

            if (ContentScaleFactor > 1)
            {
                application.ContentSearchPaths.Add("hd");
            }
            else
            {
                application.ContentSearchPaths.Add("ld");
            }

            CCScene scene = TestLayer1.Scene(mainWindow);
            mainWindow.RunWithScene(scene);
        }
Example #27
0
        public override void ApplicationDidFinishLaunching(CCApplication app, CCWindow window)
        {
            app.PreferMultiSampling = false;
            app.ContentRootDirectory = "Content";
            app.ContentSearchPaths.Add("hd");

            CCScene scene = new CCScene(window);
            CCLayerColor layer = new CCLayerColor();
            var label = new CCLabel("Tap Screen To Play!","MarkerFelt-22" , 22)
            {
                Position = layer.VisibleBoundsWorldspace.Center,
                Color = CCColor3B.Black,
                HorizontalAlignment = CCTextAlignment.Center,
                VerticalAlignment = CCVerticalTextAlignment.Center,
                AnchorPoint = CCPoint.AnchorLowerLeft,
                Dimensions = layer.ContentSize
            };
            layer.AddChild(label);
            scene.AddChild(layer);
            window.RunWithScene(scene);
        }
		public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
		{
			application.ContentRootDirectory = "Content";

			sharedWindow = mainWindow;

			DefaultResolution = new CCSize(
		application.MainWindow.WindowSizeInPixels.Width,
		application.MainWindow.WindowSizeInPixels.Height);

#if NETFX_CORE
			TouchPanel.EnableMouseTouchPoint = true;
			TouchPanel.EnableMouseGestures = true;
			application.Game.IsMouseVisible = true;
#endif
			CCScene scene = new CCScene(sharedWindow);
			CCLayer layer = new IntroLayer(DefaultResolution);

			scene.AddChild(layer);
			sharedWindow.RunWithScene(scene);
		}
Example #29
0
        /// <summary>
        ///  Implement CCDirector and CCScene init code here.
        /// </summary>
        /// <returns>
        ///  true  Initialize success, app continue.
        ///  false Initialize failed, app terminate.
        /// </returns>
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            SharedWindow = mainWindow;

            DefaultResolution = new CCSize(
                application.MainWindow.WindowSizeInPixels.Width,
                application.MainWindow.WindowSizeInPixels.Height);

            application.ContentRootDirectory = "Content";
            application.ContentSearchPaths.Add("SD");

            CCScene scene = new CCScene(mainWindow);

            StartLevelLayer firstLevel = new StartLevelLayer(DefaultResolution);
            scene.AddChild(firstLevel, (int)eTAG_DEPTH.GAME_LAYER_TAG);

            firstLevel.IsKeyboardEnabled = true;
            firstLevel.IsTouchEnabled = true;

            mainWindow.RunWithScene(scene);
        }
Example #30
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            //application.AllowUserResizing = true;
            application.PreferMultiSampling = false;
            application.ContentRootDirectory = "Content";
            application.ContentSearchPaths.Add ("animations");
            application.ContentSearchPaths.Add ("fonts");
            application.ContentSearchPaths.Add ("images");
            application.ContentSearchPaths.Add ("sounds");

            CCSize windowSize = new CCSize (600, 320);
            mainWindow.SetDesignResolutionSize (windowSize.Width, windowSize.Height, CCSceneResolutionPolicy.FixedHeight);

            CCScene scene = new CCScene (mainWindow);
            StartLevelLayer gameLayer = new StartLevelLayer ();
            scene.AddChild (gameLayer);

            mainWindow.RunWithScene (scene);
            //Hack to see all objects in right position ¿?
            scene.Position = -windowSize.Center;
        }