示例#1
0
        public override bool ApplicationDidFinishLaunching()
        {
            ContentRootDirectory = "Content";

            CCSpriteFontCache.FontScale = 0.6f;
            CCSpriteFontCache.RegisterFont("MarkerFelt", 22);

            CCDirector director = CCDirector.SharedDirector;

            director.DisplayStats      = true;
            director.AnimationInterval = 1.0 / 60;

            CCSize designSize = new CCSize(480, 320);

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

            CCDrawManager.SetDesignResolutionSize(designSize.Width, designSize.Height, CCResolutionPolicy.ShowAll);

            CCScene scene = new CCScene();

            var label = TestClass.PCLLabel(AppDelegate.PlatformMessage());

            scene.AddChild(label);

            director.RunWithScene(scene);

            return(true);
        }
        /// <summary>
        ///  Implement CCDirector and CCScene init code here.
        /// </summary>
        /// <returns>
        ///  true  Initialize success, app continue.
        ///  false Initialize failed, app terminate.
        /// </returns>
        public override bool ApplicationDidFinishLaunching()
        {
            //initialize director
            CCDirector pDirector = CCDirector.SharedDirector;

            pDirector.SetOpenGlView();


            // 2D projection
            pDirector.Projection = CCDirectorProjection.Projection2D;

            var resPolicy = CCResolutionPolicy.ExactFit; // This will stretch out your game

            CCDrawManager.SetDesignResolutionSize(preferredWidth,
                                                  preferredHeight,
                                                  resPolicy);

            // turn on display FPS
            //pDirector.DisplayStats = true;

            // set FPS. the default value is 1.0/60 if you don't call this
            pDirector.AnimationInterval = 1.0 / 60;

            CCScene pScene = IntroLayer.Scene;

            pDirector.RunWithScene(pScene);
            return(true);
        }
示例#3
0
        /// <summary>
        ///  Implement CCDirector and CCScene init code here.
        /// </summary>
        /// <returns>
        ///  true  Initialize success, app should continue.
        ///  false Initialize failed, app should terminate.
        /// </returns>
        public override bool ApplicationDidFinishLaunching()
        {
            CCSimpleAudioEngine.SharedEngine.SaveMediaState();

            CCDirector pDirector = null;

            try
            {
                // Set your design resolution here, which is the target resolution of your primary
                // design hardware.
                //
                CCDrawManager.SetDesignResolutionSize(480f, 800f, ResolutionPolicy.ShowAll);
                CCApplication.SharedApplication.GraphicsDevice.Clear(Color.Black);
                //initialize director
                pDirector = CCDirector.SharedDirector;
                pDirector.SetOpenGlView();

                //turn on display FPS
                pDirector.DisplayStats = false;

                // set FPS. the default value is 1.0/60 if you don't call this
#if WINDOWS_PHONE
                pDirector.AnimationInterval = 1f / 30f;
#else
                pDirector.AnimationInterval = 1.0 / 60;
#endif
            }
            catch (Exception ex)
            {
                CCLog.Log("ApplicationDidFinishLaunching(): Error " + ex.ToString());
            }
            return(true);
        }
        /// <summary>
        ///  Implement CCDirector and CCScene init code here.
        /// </summary>
        /// <returns>
        ///  true  Initialize success, app continue.
        ///  false Initialize failed, app terminate.
        /// </returns>
        public override bool ApplicationDidFinishLaunching()
        {
            //initialize director
            CCDirector pDirector = CCDirector.SharedDirector;

            pDirector.SetOpenGlView();
#if NETFX_CORE
            CCDrawManager.SetDesignResolutionSize(_winSize.X, _winSize.Y, CCResolutionPolicy.ExactFit);
#else
#if ANDROID
            CCDrawManager.SetDesignResolutionSize(480, 800, CCResolutionPolicy.ExactFit);
#else
            CCDrawManager.SetDesignResolutionSize(480, 800, CCResolutionPolicy.ExactFit);
#endif
            //CCDrawManager.SetDesignResolutionSize(480, 320, ResolutionPolicy.ShowAll);
#endif
            // turn on display FPS
            pDirector.DisplayStats = true;

            // set FPS. the default value is 1.0/60 if you don't call this
            pDirector.AnimationInterval = 1.0 / 60;
            pDirector.RunWithScene(new MainScene());

            return(true);
        }
示例#5
0
        /// <summary>
        ///  Implement CCDirector and CCScene init code here.
        /// </summary>
        /// <returns>
        ///  true  Initialize success, app continue.
        ///  false Initialize failed, app terminate.
        /// </returns>
        public override bool ApplicationDidFinishLaunching()
        {
            //initialize director
            CCDirector pDirector = CCDirector.SharedDirector;

            pDirector.SetOpenGlView();
#if WINDOWS
            CCDrawManager.SetDesignResolutionSize(320, 480, CCResolutionPolicy.ExactFit);
#else
            CCDrawManager.SetDesignResolutionSize(800, 480, ResolutionPolicy.ShowAll);
            //CCDrawManager.SetDesignResolutionSize(480, 320, ResolutionPolicy.ShowAll);
#endif
            // turn on display FPS
            pDirector.DisplayStats = true;

            // set FPS. the default value is 1.0/60 if you don't call this
            pDirector.AnimationInterval = 1.0 / 60;

            // create a scene. it's an autorelease object
            CCScene pScene = new CCScene();
            CCLayer pLayer = new GameLayer();

            pScene.AddChild(pLayer);
            pDirector.RunWithScene(pScene);

            return(true);
        }
示例#6
0
        /// <summary>
        ///  Implement CCDirector and CCScene init code here.
        /// </summary>
        /// <returns>
        ///  true  Initialize success, app continue.
        ///  false Initialize failed, app terminate.
        /// </returns>
        public override bool ApplicationDidFinishLaunching()
        {
            //initialize director
            CCDirector pDirector = CCDirector.SharedDirector;

            pDirector.SetOpenGlView();


            // 2D projection
            pDirector.Projection = CCDirectorProjection.Projection2D;

            // Enables High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices
            //if( ! [director_ enableRetinaDisplay:YES] )
            //	CCLOG(@"Retina Display Not supported");


#if WINDOWS || MACOS || MONOMAC || LINUX || OUYA || XBOX
            CCDrawManager.SetDesignResolutionSize(1024, 768, CCResolutionPolicy.ExactFit);
                        #else
            CCDrawManager.SetDesignResolutionSize(480, 320, CCResolutionPolicy.ShowAll);
                        #endif

            // turn on display FPS
            //pDirector.DisplayStats = true;

            // set FPS. the default value is 1.0/60 if you don't call this
            pDirector.AnimationInterval = 1.0 / 60;

            CCScene pScene = IntroLayer.Scene;

            pDirector.RunWithScene(pScene);
            return(true);
        }
示例#7
0
        /// <summary>
        /// Implement for initialize OpenGL instance, set source path, etc...
        /// </summary>
        //public override bool InitInstance()
        //{
        //    return base.InitInstance();
        //}

        /// <summary>
        ///  Implement CCDirector and CCScene init code here.
        /// </summary>
        /// <returns>
        ///  true  Initialize success, app continue.
        ///  false Initialize failed, app terminate.
        /// </returns>
        public override bool ApplicationDidFinishLaunching()
        {
            ContentRootDirectory = "Content";

            //initialize director
            var director = CCDirector.SharedDirector;

            // 2D projection
            director.Projection = CCDirectorProjection.Projection2D;

            var resPolicy = CCResolutionPolicy.ShowAll;             // This will letterbox your game

            CCDrawManager.SetDesignResolutionSize(preferredWidth,
                                                  preferredHeight,
                                                  resPolicy);

            // turn on display FPS
            //pDirector.DisplayStats = true;

            // set FPS. the default value is 1.0/60 if you don't call this
            director.AnimationInterval = 1.0 / 60;

            CCScene pScene = IntroLayer.Scene;

            director.RunWithScene(pScene);
            return(true);
        }
示例#8
0
        /// <summary>
        ///  Implement CCDirector and CCScene init code here.
        /// </summary>
        /// <returns>
        ///  true  Initialize success, app continue.
        ///  false Initialize failed, app terminate.
        /// </returns>
        public override bool ApplicationDidFinishLaunching()
        {
            //initialize director
            CCDirector pDirector = CCDirector.SharedDirector;

            pDirector.SetOpenGlView();


            var resPolicy = CCResolutionPolicy.ExactFit;             // This will stretch out your game

            CCDrawManager.SetDesignResolutionSize(preferredWidth,
                                                  preferredHeight,
                                                  resPolicy);

            // turn on display FPS
            //pDirector.DisplayStats = true;

            // set FPS. the default value is 1.0/60 if you don't call this
            pDirector.AnimationInterval = 1.0 / 60;


            //
            // HERE! This is where you start your game. Create the first scene for your
            // game, or reconstruct the state of the last save.
            CCScene pScene = IntroLayer.Scene;

            pDirector.RunWithScene(pScene);
            return(true);
        }
示例#9
0
        /// <summary>
        ///  Implement CCDirector and CCScene init code here.
        /// </summary>
        /// <returns>
        ///  true  Initialize success, app continue.
        ///  false Initialize failed, app terminate.
        /// </returns>
        public override bool ApplicationDidFinishLaunching()
        {
            //initialize director
            CCDirector pDirector = CCDirector.SharedDirector;

            pDirector.SetOpenGlView();

            CCSpriteFontCache.RegisterFont("arial", 12, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 38, 50, 64);
            CCSpriteFontCache.RegisterFont("MarkerFelt", 16, 18, 22);
            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);

            // turn on display FPS
            pDirector.DisplayStats = true;
            // set FPS. the default value is 1.0/60 if you don't call this
            pDirector.AnimationInterval = 1.0 / 60;

            CCSize designSize = new CCSize(480, 320);

            if (CCDrawManager.FrameSize.Height > 320)
            {
                CCSize resourceSize = new CCSize(960, 640);
                CCContentManager.SharedContentManager.SearchPaths.Add("hd");
                pDirector.ContentScaleFactor = resourceSize.Height / designSize.Height;
            }

            CCDrawManager.SetDesignResolutionSize(designSize.Width, designSize.Height, CCResolutionPolicy.ShowAll);

/*
 #if WINDOWS || WINDOWSGL
 *          CCDrawManager.SetDesignResolutionSize(1280, 768, CCResolutionPolicy.ExactFit);
 #else
 *          CCDrawManager.SetDesignResolutionSize(800, 480, CCResolutionPolicy.ShowAll);
 *          //CCDrawManager.SetDesignResolutionSize(480, 320, CCResolutionPolicy.ShowAll);
 #endif
 */

            // create a scene. it's an autorelease object
            CCScene pScene = new CCScene();
            CCLayer pLayer = new TestController();

            /*
             * CCScene pScene = CCScene.node();
             * var pLayer = Box2DView.viewWithEntryID(0);
             * pLayer.scale = 10;
             * pLayer.anchorPoint = new CCPoint(0, 0);
             * pLayer.position = new CCPoint(CCDirector.sharedDirector().getWinSize().width / 2, CCDirector.sharedDirector().getWinSize().height / 4);
             */

            pScene.AddChild(pLayer);
            pDirector.RunWithScene(pScene);

            return(true);
        }
示例#10
0
        public override bool ApplicationDidFinishLaunching()
        {
            CCDirector.SharedDirector.SetOpenGlView();
            CCDirector.SharedDirector.Projection = CCDirectorProjection.Projection2D;
            CCDrawManager.SetDesignResolutionSize(PreferredWidth, PreferredHeight, CCResolutionPolicy.ShowAll);
            CCDirector.SharedDirector.DisplayStats      = true;
            CCDirector.SharedDirector.AnimationInterval = 1.0 / 60;
            CCDirector.SharedDirector.RunWithScene(new GameScene());

            return(true);
        }
示例#11
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)
        {
            //1280 x 768
#if WINDOWS_PHONE
            preferredWidth  = 1280;
            preferredHeight = 768;
#else
            preferredWidth  = 1024;
            preferredHeight = 768;
#endif

            application.PreferredBackBufferWidth  = preferredWidth;
            application.PreferredBackBufferHeight = preferredHeight;

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

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

            CCDirector director = CCApplication.SharedApplication.MainWindowDirector;
            director.DisplayStats      = true;
            director.AnimationInterval = 1.0 / 60;

            CCSize designSize = new CCSize(480, 320);

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

            CCDrawManager.SetDesignResolutionSize(designSize.Width, designSize.Height, CCResolutionPolicy.ShowAll);

            // turn on display FPS
            director.DisplayStats = true;

            // set FPS. the default value is 1.0/60 if you don't call this
            director.AnimationInterval = 1.0 / 60;

            CCScene pScene = IntroLayer.Scene;

            director.RunWithScene(pScene);
        }
示例#12
0
        /// <summary>
        ///  Implement CCDirector and CCScene init code here.
        /// </summary>
        /// <returns>
        ///  true  Initialize success, app continue.
        ///  false Initialize failed, app terminate.
        /// </returns>
        public override bool ApplicationDidFinishLaunching()
        {
            //initialize director
            CCDirector pDirector = CCDirector.SharedDirector;

            pDirector.SetOpenGlView();
#if WINDOWS
            DrawManager.SetDesignResolutionSize(1024, 768, ResolutionPolicy.ExactFit);
#else
            CCDrawManager.SetDesignResolutionSize(800, 480, ResolutionPolicy.ShowAll);
            //DrawManager.SetDesignResolutionSize(480, 320, ResolutionPolicy.ShowAll);
#endif
            // turn on display FPS
            pDirector.DisplayStats = true;

            // pDirector->setDeviceOrientation(kCCDeviceOrientationLandscapeLeft);

            // set FPS. the default value is 1.0/60 if you don't call this
            pDirector.AnimationInterval = 1.0 / 60;

            // create a scene. it's an autorelease object
            CCScene pScene = new CCScene();
            CCLayer pLayer = new TestController();

            /*
             * CCScene pScene = CCScene.node();
             * var pLayer = Box2DView.viewWithEntryID(0);
             * pLayer.scale = 10;
             * pLayer.anchorPoint = new CCPoint(0, 0);
             * pLayer.position = new CCPoint(CCDirector.sharedDirector().getWinSize().width / 2, CCDirector.sharedDirector().getWinSize().height / 4);
             */

            pScene.AddChild(pLayer);
            pDirector.RunWithScene(pScene);

            return(true);
        }