예제 #1
0
        public override bool Init()
        {
            if (base.Init())
            {
                // ask director the the window size
                CCSize size = CCDirector.SharedDirector.WinSize;

                QuestionContainerSprite question = new QuestionContainerSprite();
                QuestionContainerSprite question2 = new QuestionContainerSprite();
                question.Init();
                question2.Init();

                //		[question setContentSize:CGSizeMake(50,50)];
                //		[question2 setContentSize:CGSizeMake(50,50)];

                CCMenuItemSprite sprite = new CCMenuItemSprite(question2, question, this, selectAnswer);
                CCLayerColor layer = new CCLayerColor(new CCColor4B(0, 0, 255, 255), 100, 100);

                CCLayerColor layer2 = new CCLayerColor(new CCColor4B(255, 0, 0, 255), 100, 100);
                CCMenuItemSprite sprite2 = new CCMenuItemSprite(layer, layer2, this, selectAnswer);
                CCMenu menu = new CCMenu(sprite, sprite2, null);
                menu.AlignItemsVerticallyWithPadding(100);
                menu.Position = new CCPoint(size.Width / 2, size.Height / 2);

                // add the label as a child to this Layer
                AddChild(menu);

                return true;
            }
            return false;
        }
예제 #2
0
        public override bool init()
        {
            if (base.init())
            {
                // ask director the the window size
                CCSize size = CCDirector.sharedDirector().getWinSize();

                QuestionContainerSprite question = new QuestionContainerSprite();
                QuestionContainerSprite question2 = new QuestionContainerSprite();
                question.init();
                question2.init();

                //		[question setContentSize:CGSizeMake(50,50)];
                //		[question2 setContentSize:CGSizeMake(50,50)];

                CCMenuItemSprite sprite = CCMenuItemSprite.itemFromNormalSprite(question2, question, this, selectAnswer);
                CCLayerColor layer = CCLayerColor.layerWithColorWidthHeight(new ccColor4B(0, 0, 255, 255), 100, 100);

                CCLayerColor layer2 = CCLayerColor.layerWithColorWidthHeight(new ccColor4B(255, 0, 0, 255), 100, 100);
                CCMenuItemSprite sprite2 = CCMenuItemSprite.itemFromNormalSprite(layer, layer2, this, selectAnswer);
                CCMenu menu = CCMenu.menuWithItems(sprite, sprite2, null);
                menu.alignItemsVerticallyWithPadding(100);
                menu.position = new CCPoint(size.width / 2, size.height / 2);

                // add the label as a child to this Layer
                addChild(menu);

                return true;
            }
            return false;
        }
예제 #3
0
        public override bool Init()
        {
            if (base.Init())
            {
                // ask director the the window size
                CCSize size = CCDirector.SharedDirector.WinSize;

                QuestionContainerSprite question  = new QuestionContainerSprite();
                QuestionContainerSprite question2 = new QuestionContainerSprite();
                question.Init();
                question2.Init();

                //		[question setContentSize:CGSizeMake(50,50)];
                //		[question2 setContentSize:CGSizeMake(50,50)];

                CCMenuItemSprite sprite = new CCMenuItemSprite(question2, question, this, selectAnswer);
                CCLayerColor     layer  = new CCLayerColor(new CCColor4B(0, 0, 255, 255), 100, 100);


                CCLayerColor     layer2  = new CCLayerColor(new CCColor4B(255, 0, 0, 255), 100, 100);
                CCMenuItemSprite sprite2 = new CCMenuItemSprite(layer, layer2, this, selectAnswer);
                CCMenu           menu    = new CCMenu(sprite, sprite2, null);
                menu.AlignItemsVerticallyWithPadding(100);
                menu.Position = new CCPoint(size.Width / 2, size.Height / 2);

                // add the label as a child to this Layer
                AddChild(menu);

                return(true);
            }
            return(false);
        }
예제 #4
0
        public override bool init()
        {
            if (base.init())
            {
                // ask director the the window size
                CCSize size = CCDirector.sharedDirector().getWinSize();

                QuestionContainerSprite question  = new QuestionContainerSprite();
                QuestionContainerSprite question2 = new QuestionContainerSprite();
                question.init();
                question2.init();

                //		[question setContentSize:CGSizeMake(50,50)];
                //		[question2 setContentSize:CGSizeMake(50,50)];

                CCMenuItemSprite sprite = CCMenuItemSprite.itemFromNormalSprite(question2, question, this, selectAnswer);
                CCLayerColor     layer  = CCLayerColor.layerWithColorWidthHeight(new ccColor4B(0, 0, 255, 255), 100, 100);


                CCLayerColor     layer2  = CCLayerColor.layerWithColorWidthHeight(new ccColor4B(255, 0, 0, 255), 100, 100);
                CCMenuItemSprite sprite2 = CCMenuItemSprite.itemFromNormalSprite(layer, layer2, this, selectAnswer);
                CCMenu           menu    = CCMenu.menuWithItems(sprite, sprite2, null);
                menu.alignItemsVerticallyWithPadding(100);
                menu.position = new CCPoint(size.width / 2, size.height / 2);

                // add the label as a child to this Layer
                addChild(menu);

                return(true);
            }
            return(false);
        }
예제 #5
0
파일: Bug-458.cs 프로젝트: h7ing/CocosSharp
        private void InitBug458Layer()
        {
            // ask director the the window size
            CCSize size = Layer.VisibleBoundsWorldspace.Size;

            QuestionContainerSprite question = new QuestionContainerSprite();
            QuestionContainerSprite question2 = new QuestionContainerSprite();

            //		[question setContentSize:CGSizeMake(50,50)];
            //		[question2 setContentSize:CGSizeMake(50,50)];

            CCMenuItemImage sprite = new CCMenuItemImage(question2, question, selectAnswer);

            //CCLayerColor layer = new CCLayerColor(new CCColor4B(0, 0, 255, 255), 100, 100);
            //CCLayerColor layer2 = new CCLayerColor(new CCColor4B(255, 0, 0, 255), 100, 100);
            //CCMenuItemImage sprite2 = new CCMenuItemImage(layer, layer2, this, selectAnswer);
            CCMenu menu = new CCMenu(sprite, null);
            menu.AlignItemsVertically(100);
            menu.Position = new CCPoint(size.Width / 2, size.Height / 2);

            // add the label as a child to this Layer
            AddChild(menu);

        }
예제 #6
0
        private void InitBug458Layer()
        {
            // ask director the the window size
            CCSize size = Layer.VisibleBoundsWorldspace.Size;

            QuestionContainerSprite question  = new QuestionContainerSprite();
            QuestionContainerSprite question2 = new QuestionContainerSprite();

            //		[question setContentSize:CGSizeMake(50,50)];
            //		[question2 setContentSize:CGSizeMake(50,50)];

            CCMenuItemImage sprite = new CCMenuItemImage(question2, question, selectAnswer);

            //CCLayerColor layer = new CCLayerColor(new CCColor4B(0, 0, 255, 255), 100, 100);
            //CCLayerColor layer2 = new CCLayerColor(new CCColor4B(255, 0, 0, 255), 100, 100);
            //CCMenuItemImage sprite2 = new CCMenuItemImage(layer, layer2, this, selectAnswer);
            CCMenu menu = new CCMenu(sprite, null);

            menu.AlignItemsVertically(100);
            menu.Position = new CCPoint(size.Width / 2, size.Height / 2);

            // add the label as a child to this Layer
            AddChild(menu);
        }