Esempio n. 1
0
        /// <summary>
        /// there's no 'id' in cpp, so we recommand to return the exactly class pointer
        /// </summary>
        public static CCScene scene()
        {
            // 'scene' is an autorelease object
            CCScene scene = CCScene.node();

            // 'layer' is an autorelease object
            CCLayer layer = HelloCocos2dScene.node();

            // add layer as a child to scene
            scene.addChild(layer);

            // return the scene
            return(scene);
        }
Esempio n. 2
0
        public static new CCLayer node()
        {
            HelloCocos2dScene ret = new HelloCocos2dScene();

            if (ret.init())
            {
                return(ret);
            }
            else
            {
                ret = null;
            }

            return(ret);
        }
Esempio n. 3
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
            Director pDirector = Director.SharedDirector;

            //turn on display FPS
            //pDirector.DisplayFPS=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 = HelloCocos2dScene.scene();

            //run
            pDirector.RunWithScene(pScene);

            return(true);
        }
        public static new CCLayer node()
        {
            HelloCocos2dScene ret = new HelloCocos2dScene();
            if (ret.init())
            {
                return ret;
            }
            else
            {
                ret = null;
            }

            return ret;
        }