• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# cocos2d.CCLabelTTF类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中cocos2d.CCLabelTTF的典型用法代码示例。如果您正苦于以下问题:C# CCLabelTTF类的具体用法?C# CCLabelTTF怎么用?C# CCLabelTTF使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CCLabelTTF类属于cocos2d命名空间,在下文中一共展示了CCLabelTTF类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Create

 /** Creates a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels. */
 public static CCControlSwitch Create(CCSprite maskSprite, CCSprite onSprite, CCSprite offSprite, CCSprite thumbSprite, CCLabelTTF onLabel,
                                      CCLabelTTF offLabel)
 {
     var pRet = new CCControlSwitch();
     pRet.InitWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, onLabel, offLabel);
     return pRet;
 }
开发者ID:eickegao,项目名称:cocos2d-xna,代码行数:8,代码来源:CCControlSwitch.cs


示例2: setDisplayValueLabel

 public virtual void setDisplayValueLabel(CCLabelTTF var)
 {
     if (m_pDisplayValueLabel != var)
     {
         m_pDisplayValueLabel = var;
     }
 }
开发者ID:eickegao,项目名称:cocos2d-xna,代码行数:7,代码来源:CCControlButtonTest.cs


示例3: OnEnter

        public override void OnEnter()
        {
            //
            // This test MUST be done in 'onEnter' and not on 'init'
            // otherwise the paused action will be resumed at 'onEnter' time
            //
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCLabelTTF l = new CCLabelTTF("After 5 seconds grossini should move", "arial", 16);
            AddChild(l);
            l.Position = (new CCPoint(s.Width / 2, 245));

            //
            // Also, this test MUST be done, after [super onEnter]
            //
            CCSprite grossini = new CCSprite(s_pPathGrossini);
            AddChild(grossini, 0, kTagGrossini);
            grossini.Position = (new CCPoint(200, 200));

            CCAction action = new CCMoveBy (1, new CCPoint(150, 0));

            CCDirector.SharedDirector.ActionManager.AddAction(action, grossini, true);

            Schedule(unpause, 3);
        }
开发者ID:homocury,项目名称:cocos2d-xna,代码行数:27,代码来源:PauseTest.cs


示例4: OnEnter

        public override void OnEnter()
        {
            base.OnEnter();
            m_grossini = new CCSprite(TestResource.s_pPathGrossini);
            m_tamara = new CCSprite(TestResource.s_pPathSister1);
            m_kathia = new CCSprite(TestResource.s_pPathSister2);

            AddChild(m_grossini, 3);
            AddChild(m_kathia, 2);
            AddChild(m_tamara, 1);

            var s = CCDirector.SharedDirector.WinSize;

            m_grossini.Position = new CCPoint(60, 50);
            m_kathia.Position = new CCPoint(60, 150);
            m_tamara.Position = new CCPoint(60, 250);

            var label = new CCLabelTTF(title(), "arial", 32);
            AddChild(label);
            label.Position = new CCPoint(s.Width / 2, s.Height - 50);

            var item1 = new CCMenuItemImage(TestResource.s_pPathB1, TestResource.s_pPathB2, backCallback);
            var item2 = new CCMenuItemImage(TestResource.s_pPathR1, TestResource.s_pPathR2, restartCallback);
            var item3 = new CCMenuItemImage(TestResource.s_pPathF1, TestResource.s_pPathF2, nextCallback);

            var menu = new CCMenu(item1, item2, item3);
            menu.Position = CCPoint.Zero;
            item1.Position = new CCPoint(s.Width / 2 - 100, 30);
            item2.Position = new CCPoint(s.Width / 2, 30);
            item3.Position = new CCPoint(s.Width / 2 + 100, 30);

            AddChild(menu, 1);
        }
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:33,代码来源:EaseActionsTest.cs


示例5: TileDemo

        public TileDemo()
        {
            base.isTouchEnabled = true;

            CCSize s = CCDirector.sharedDirector().getWinSize();

            m_label = CCLabelTTF.labelWithString("not", "Arial", 28);
            addChild(m_label, 1);
            m_label.position = new CCPoint(s.width / 2, s.height - 50);

            string strSubtitle = subtitle();
            if (strSubtitle == null)
            {
                CCLabelTTF l = CCLabelTTF.labelWithString(strSubtitle, "Arial", 16);
                addChild(l, 1);
                l.position = new CCPoint(s.width / 2, s.height - 80);

                m_subtitle = l;
            }

            CCMenuItemImage item1 = CCMenuItemImage.itemFromNormalImage(s_pPathB1, s_pPathB2, this, backCallback);
            CCMenuItemImage item2 = CCMenuItemImage.itemFromNormalImage(s_pPathR1, s_pPathR2, this, restartCallback);
            CCMenuItemImage item3 = CCMenuItemImage.itemFromNormalImage(s_pPathF1, s_pPathF2, this, nextCallback);


            item1.position = new CCPoint(s.width / 2 - 100, 30);
            item2.position = new CCPoint(s.width / 2, 30);
            item3.position = new CCPoint(s.width / 2 + 100, 30);

            CCMenu menu = CCMenu.menuWithItems(item1, item2, item3);
            menu.position = new CCPoint(0, 0);
            addChild(menu, 1);
        }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:33,代码来源:TileDemo.cs


示例6: OnEnter

        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCLabelTTF label = new CCLabelTTF(title(), "arial", 28);
            AddChild(label, 1);
            label.Position = new CCPoint(s.Width / 2, s.Height - 50);

            string strSubtitle = subtitle();
            if (!string.IsNullOrEmpty(strSubtitle))
            {
                CCLabelTTF l = new CCLabelTTF(strSubtitle, "arial", 16);
                //CCLabelTTF l = CCLabelTTF.labelWithString(strSubtitle, "Thonburi", 16);
                AddChild(l, 1);
                l.Position = new CCPoint(s.Width / 2, s.Height - 80);
            }

            CCMenuItemImage item1 = new CCMenuItemImage("Images/b1", "Images/b2", backCallback);
            CCMenuItemImage item2 = new CCMenuItemImage("Images/r1", "Images/r2", restartCallback);
            CCMenuItemImage item3 = new CCMenuItemImage("Images/f1", "Images/f2", nextCallback);

            CCMenu menu = CCMenu.Create(item1, item2, item3);

            menu.Position = new CCPoint();
            item1.Position = new CCPoint(s.Width / 2 - 100, 30);
            item2.Position = new CCPoint(s.Width / 2, 30);
            item3.Position = new CCPoint(s.Width / 2 + 100, 30);

            AddChild(menu, 1);
        }
开发者ID:homocury,项目名称:cocos2d-xna,代码行数:32,代码来源:SpriteTestDemo.cs


示例7: GameOverScene

 public GameOverScene(bool isWin)
 {
     CCLayerColor colorLayer = CCLayerColor.layerWithColor(new ccColor4B(255, 255, 255, 255));
     this.addChild(colorLayer);
     CCSize winSize = CCDirector.sharedDirector().getWinSize();
     string msg;
     if (isWin)
         msg = "YOU WIN";
     else
         msg = "YOU LOSE";
     label = CCLabelTTF.labelWithString(msg, "Arial", 32);
     label.Color = new ccColor3B(0, 0, 0);
     label.position = new CCPoint(winSize.width / 2, winSize.height / 2 + 100);
     this.addChild(label);
     //this.runAction(CCSequence.actions(CCDelayTime.actionWithDuration(3), CCCallFunc.actionWithTarget(this, gameOverDone)));
     var itemReplay = CCMenuItemImage.itemFromNormalImage(@"images/reload", @"images/reload", this, replay);
     var itemMainMenu = CCMenuItemImage.itemFromNormalImage(@"images/mainmenu", @"images/mainmenu", this, mainmenu);
     var itemNextLevel = CCMenuItemImage.itemFromNormalImage(@"images/nextlevel", @"images/nextlevel", this, nextlevel);
     if (!isWin)
         itemNextLevel.visible = false;
     var menu = CCMenu.menuWithItems(itemReplay, itemMainMenu, itemNextLevel);
     menu.alignItemsHorizontally();
     menu.position = new CCPoint(winSize.width / 2, winSize.height / 2 - 100);
     this.addChild(menu);
 }
开发者ID:no10pc,项目名称:cocos2dSimpleGame,代码行数:25,代码来源:GameOverScene.cs


示例8: LabelTTFChinese

 public LabelTTFChinese()
 {
     CCSize size = CCDirector.SharedDirector.WinSize;
     CCLabelTTF pLable = new CCLabelTTF("中国", "Marker Felt", 30);
     pLable.Position = new CCPoint(size.Width / 2, size.Height / 2);
     AddChild(pLable);
 }
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:7,代码来源:LabelTTFChinese.cs


示例9: OnEnter

        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCLabelTTF label = new CCLabelTTF(title(), "arial", 32);
            AddChild(label, 1);
            label.Position = (new CCPoint(s.Width / 2, s.Height - 50));

            string strSubtitle = subtitle();
            if (!string.IsNullOrEmpty(strSubtitle))
            {
                CCLabelTTF l = new CCLabelTTF(strSubtitle, "arial", 16);
                AddChild(l, 1);
                l.Position = (new CCPoint(s.Width / 2, s.Height - 80));
            }

            CCMenuItemImage item1 = new CCMenuItemImage(TestResource.s_pPathB1, TestResource.s_pPathB2, backCallback);
            CCMenuItemImage item2 = new CCMenuItemImage(TestResource.s_pPathR1, TestResource.s_pPathR2, restartCallback);
            CCMenuItemImage item3 = new CCMenuItemImage(TestResource.s_pPathF1, TestResource.s_pPathF2, nextCallback);

            CCMenu menu = CCMenu.Create(item1, item2, item3);

            menu.Position = new CCPoint(0, 0);
            item1.Position = new CCPoint(s.Width / 2 - 100, 30);
            item2.Position = new CCPoint(s.Width / 2, 30);
            item3.Position = new CCPoint(s.Width / 2 + 100, 30);

            AddChild(menu, 1);
        }
开发者ID:homocury,项目名称:cocos2d-xna,代码行数:31,代码来源:TestCocosNodeDemo.cs


示例10: OnEnter

        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCLabelTTF label = new CCLabelTTF(title(), "arial", 32);
            AddChild(label, 1);
            label.Position = (new CCPoint(s.Width / 2, s.Height - 50));

            string subtitle_ = subtitle();
            if (subtitle_.Length > 0)
            {
                CCLabelTTF l = new CCLabelTTF(subtitle_, "arial", 16);
                AddChild(l, 1);
                l.Position = (new CCPoint(s.Width / 2, s.Height - 80));
            }

            CCMenuItemImage item1 = new CCMenuItemImage(s_pPathB1, s_pPathB2, (backCallback));
            CCMenuItemImage item2 = new CCMenuItemImage(s_pPathR1, s_pPathR2, (restartCallback));
            CCMenuItemImage item3 = new CCMenuItemImage(s_pPathF1, s_pPathF2, (nextCallback));

            CCMenu menu = new CCMenu(item1, item2, item3);

            menu.Position = new CCPoint(0, 0);
            item1.Position = new CCPoint(s.Width / 2 - 100, 30);
            item2.Position = new CCPoint(s.Width / 2, 30);
            item3.Position = new CCPoint(s.Width / 2 + 100, 30);

            AddChild(menu, 1);
        }
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:31,代码来源:Layertest.cs


示例11: TableCellAtIndex

        public virtual CCTableViewCell TableCellAtIndex(CCTableView table, int idx)
        {
            string str = idx.ToString();
            var cell = table.DequeueCell();

            if (cell == null) {
                cell = new CustomTableViewCell();
                var sprite = new CCSprite("Images/Icon");
                sprite.AnchorPoint = CCPoint.Zero;
                sprite.Position = new CCPoint(0, 0);
                cell.AddChild(sprite);

                var label = new CCLabelTTF(str, "Helvetica", 20.0f);
                label.Position = CCPoint.Zero;
                label.AnchorPoint = CCPoint.Zero;
                label.Tag = 123;
                cell.AddChild(label);
            }
            else
            {
                var label = (CCLabelTTF)cell.GetChildByTag(123);
                label.Label = (str);
            }

            return cell;
        }
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:26,代码来源:TableViewTestScene.cs


示例12: OnEnter

        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCLabelTTF label = new CCLabelTTF(title(), "arial", 18);
            AddChild(label, 1);
            label.Position = new CCPoint(s.Width / 2, s.Height - 50);

            string strSubtitle = subtitle();
            if (strSubtitle != null)
            {
                CCLabelTTF l = new CCLabelTTF(strSubtitle, "arial", 22);
                AddChild(l, 1);
                l.Position = new CCPoint(s.Width / 2, s.Height - 80);
            }

            CCMenuItemImage item1 = new CCMenuItemImage(s_pPathB1, s_pPathB2, backCallback);
            CCMenuItemImage item2 = new CCMenuItemImage(s_pPathR1, s_pPathR2, restartCallback);
            CCMenuItemImage item3 = new CCMenuItemImage(s_pPathF1, s_pPathF2, nextCallback);

            CCMenu menu = new CCMenu(item1, item2, item3);

            menu.Position = new CCPoint(0, 0);
            item1.Position = new CCPoint(s.Width / 2 - 100, 30);
            item2.Position = new CCPoint(s.Width / 2, 30);
            item3.Position = new CCPoint(s.Width / 2 + 100, 30);

            AddChild(menu, 1);

            CCLayerColor background = new CCLayerColor(new CCColor4B(255,0,0,255));
            AddChild(background, -10);
        }
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:34,代码来源:SpriteDemo.cs


示例13: Box2DTestLayer

        public Box2DTestLayer()
        {
            TouchEnabled = true;
            AccelerometerEnabled = true;
            CCSize s = CCDirector.SharedDirector.WinSize;
            // init physics
            initPhysics();
            // create reset button
            createResetButton();

            //Set up sprite
            // Use batch node. Faster
            _batch = CCSpriteBatchNode.Create("Images/blocks", 100);
            m_pSpriteTexture = _batch.Texture;
            AddChild(_batch, 0, kTagParentNode);

            addNewSpriteAtPosition(new CCPoint(s.Width / 2, s.Height / 2));

            CCLabelTTF label = new CCLabelTTF("Tap screen", "Marker Felt", 32);
            AddChild(label, 0);
            label.Color = new CCColor3B(0, 0, 255);
            label.Position = new CCPoint(s.Width / 2, s.Height - 50);

            ScheduleUpdate();
        }
开发者ID:eickegao,项目名称:cocos2d-xna,代码行数:25,代码来源:Box2DTest.cs


示例14: GitHubIssue5

 public GitHubIssue5()
 {
     CCSize s = CCDirector.SharedDirector.WinSize;
     _TestLabel = new CCLabelTTF("", "Arial", 10);
     AddChild(_TestLabel);
     _TestLabel.Position = new CCPoint(s.Width / 2, s.Height / 4 * 2);
 }
开发者ID:homocury,项目名称:cocos2d-xna,代码行数:7,代码来源:GitHubIssue5.cs


示例15: OnEnter

        public override void OnEnter()
        {
            base.OnEnter();

            CCApplication.SharedApplication.GamePadButtonUpdate += _GamePadButtonDelegate;
            CCApplication.SharedApplication.GamePadDPadUpdate += _GamePadDPadDelegate;
            CCApplication.SharedApplication.GamePadStickUpdate += _GamePadStickDelegate;
            CCApplication.SharedApplication.GamePadTriggerUpdate += _GamePadTriggerDelegate;

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCLabelTTF label = new CCLabelTTF(title(), "arial", 28);
            AddChild(label, 1);
            label.Position = new CCPoint(s.Width / 2, s.Height - 50);

            CCMenuItemImage item1 = new CCMenuItemImage(s_pPathB1, s_pPathB2, backCallback);
            CCMenuItemImage item2 = new CCMenuItemImage(s_pPathR1, s_pPathR2, restartCallback);
            CCMenuItemImage item3 = new CCMenuItemImage(s_pPathF1, s_pPathF2, nextCallback);

            CCMenu menu = new CCMenu(item1, item2, item3);

            menu.Position = new CCPoint(0, 0);
            item1.Position = new CCPoint(s.Width / 2 - 100, 30);
            item2.Position = new CCPoint(s.Width / 2, 30);
            item3.Position = new CCPoint(s.Width / 2 + 100, 30);

            AddChild(menu, 1);
        }
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:28,代码来源:ParallaxDemo.cs


示例16: RenderTextureZbuffer

        public RenderTextureZbuffer()
        {
            //this->setIsTouchEnabled(true);
            TouchEnabled = true;
            CCSize size = CCDirector.SharedDirector.WinSize;
            CCLabelTTF label = new CCLabelTTF("vertexZ = 50", "Marker Felt", 32);
            label.Position = new CCPoint(size.Width / 2, size.Height * 0.25f);
            AddChild(label);

            CCLabelTTF label2 = new CCLabelTTF("vertexZ = 0", "Marker Felt", 32);
            label2.Position = new CCPoint(size.Width / 2, size.Height * 0.5f);
            AddChild(label2);

            CCLabelTTF label3 = new CCLabelTTF("vertexZ = -50", "Marker Felt", 32);
            label3.Position = new CCPoint(size.Width / 2, size.Height * 0.75f);
            AddChild(label3);

            label.VertexZ = 50;
            label2.VertexZ = 0;
            label3.VertexZ = -50;

            CCSpriteFrameCache.SharedSpriteFrameCache.AddSpriteFramesWithFile("Images/bugs/circle.plist");

            mgr = CCSpriteBatchNode.Create("Images/bugs/circle", 9);
            AddChild(mgr);

            sp1 = new CCSprite("Images/bugs/circle");
            sp2 = new CCSprite("Images/bugs/circle");
            sp3 = new CCSprite("Images/bugs/circle");
            sp4 = new CCSprite("Images/bugs/circle");
            sp5 = new CCSprite("Images/bugs/circle");
            sp6 = new CCSprite("Images/bugs/circle");
            sp7 = new CCSprite("Images/bugs/circle");
            sp8 = new CCSprite("Images/bugs/circle");
            sp9 = new CCSprite("Images/bugs/circle");

            mgr.AddChild(sp1, 9);
            mgr.AddChild(sp2, 8);
            mgr.AddChild(sp3, 7);
            mgr.AddChild(sp4, 6);
            mgr.AddChild(sp5, 5);
            mgr.AddChild(sp6, 4);
            mgr.AddChild(sp7, 3);
            mgr.AddChild(sp8, 2);
            mgr.AddChild(sp9, 1);

            sp1.VertexZ = 400;
            sp2.VertexZ = 300;
            sp3.VertexZ = 200;
            sp4.VertexZ = 100;
            sp5.VertexZ = 0;
            sp6.VertexZ = -100;
            sp7.VertexZ = -200;
            sp8.VertexZ = -300;
            sp9.VertexZ = -400;

            sp9.Scale = 2;
            sp9.Color = CCTypes.CCYellow;
        }
开发者ID:homocury,项目名称:cocos2d-xna,代码行数:59,代码来源:RenderTextureZbuffer.cs


示例17: init

        public override bool init()
        {
            if (!base.init())
                return false;
            if (!base.init())
            {
                return false;
            }

            CCSize winSize = CCDirector.sharedDirector().getWinSize();
            title = CCLabelTTF.labelWithString("FootBall", "Arial", 24);
            title.position = new CCPoint(winSize.width / 2, winSize.height - 50);
            this.addChild(title, 1);
            ball = CCSprite.spriteWithFile(@"images/ball");
            ball.position = new CCPoint(100, 300);
            this.addChild(ball);
            Vector2 gravity = new Vector2(0.0f, -30.0f);
            bool doSleep = true;
            world = new World(gravity, doSleep);
            /////////////////////////
            BodyDef groundBodyDef = new BodyDef();
            groundBodyDef.position = new Vector2(0, 0);
            Body groundBody = world.CreateBody(groundBodyDef);
            PolygonShape groundBox = new PolygonShape();
            FixtureDef boxShapeDef = new FixtureDef();
            boxShapeDef.shape = groundBox;

            groundBox.SetAsEdge(new Vector2(0, 0), new Vector2((float)(winSize.width / PTM_RATIO), 0));
            groundBody.CreateFixture(boxShapeDef);
            groundBox.SetAsEdge(new Vector2(0, 0), new Vector2(0, (float)(winSize.height / PTM_RATIO)));
            groundBody.CreateFixture(boxShapeDef);
            groundBox.SetAsEdge(new Vector2(0, (float)(winSize.height / PTM_RATIO)),
                new Vector2((float)(winSize.width / PTM_RATIO), (float)(winSize.height / PTM_RATIO)));
            groundBody.CreateFixture(boxShapeDef);
            groundBox.SetAsEdge(new Vector2((float)(winSize.width / PTM_RATIO), (float)(winSize.height / PTM_RATIO)),
                new Vector2((float)(winSize.width / PTM_RATIO), 0));
            groundBody.CreateFixture(boxShapeDef);

            BodyDef ballBodyDef = new BodyDef();
            ballBodyDef.type = BodyType.Dynamic;
            ballBodyDef.position = new Vector2(
                (float)(100 / PTM_RATIO),
                (float)(300 / PTM_RATIO));
            ballBodyDef.userData = ball;
            body = world.CreateBody(ballBodyDef);

            CircleShape circle = new CircleShape();
            circle._radius = (float)(26.0 / PTM_RATIO);

            FixtureDef ballShapeDef = new FixtureDef();
            ballShapeDef.shape = circle;
            ballShapeDef.density = 1.0f;
            ballShapeDef.friction = 0.0f;
            ballShapeDef.restitution = 1.0f;
            body.CreateFixture(ballShapeDef);

            this.schedule(tick);
            return true;
        }
开发者ID:no10pc,项目名称:cocos2dSimpleGame,代码行数:59,代码来源:BOX2DLayer.cs


示例18: TextLayer

        public TextLayer()
        {
            InitWithColor(CCTypes.CreateColor(32, 32, 32, 255));

            float x, y;

            CCSize size = CCDirector.SharedDirector.WinSize;
            x = size.Width;
            y = size.Height;

            CCNode node = new CCNode ();
            CCActionInterval effect = getAction();
            node.RunAction(effect);
            AddChild(node, 0, EffectTestScene.kTagBackground);

            CCSprite bg = new CCSprite(TestResource.s_back3);
            node.AddChild(bg, 0);
            bg.AnchorPoint = new CCPoint(0.5f, 0.5f);
            bg.Position = new CCPoint(size.Width / 2, size.Height / 2);

            CCSprite grossini = new CCSprite(TestResource.s_pPathSister2);
            node.AddChild(grossini, 1);
            grossini.Position = new CCPoint(x / 3, y / 2);
            CCActionInterval sc = new CCScaleBy(2, 5);
            CCFiniteTimeAction sc_back = sc.Reverse();
            grossini.RunAction(new CCRepeatForever ((CCActionInterval)(CCSequence.FromActions(sc, sc_back))));
            //grossini.runAction(effect);

            CCSprite tamara = new CCSprite(TestResource.s_pPathSister1);
            node.AddChild(tamara, 1);
            tamara.Position = new CCPoint(2 * x / 3, y / 2);
            CCActionInterval sc2 = new CCScaleBy(2, 5);
            CCFiniteTimeAction sc2_back = sc2.Reverse();
            tamara.RunAction(new CCRepeatForever ((CCActionInterval)(CCSequence.FromActions(sc2, sc2_back))));

            CCLabelTTF label = new CCLabelTTF(EffectTestScene.effectsList[EffectTestScene.actionIdx], "arial", 32);

            label.Position = new CCPoint(x / 2, y - 80);
            AddChild(label);
            label.Tag = EffectTestScene.kTagLabel;

            CCMenuItemImage item1 = new CCMenuItemImage(TestResource.s_pPathB1, TestResource.s_pPathB2, backCallback);
            CCMenuItemImage item2 = new CCMenuItemImage(TestResource.s_pPathR1, TestResource.s_pPathR2, restartCallback);
            CCMenuItemImage item3 = new CCMenuItemImage(TestResource.s_pPathF1, TestResource.s_pPathF2, nextCallback);

            CCMenu menu = new CCMenu(item1, item2, item3);

            menu.Position = new CCPoint(0, 0);
            item1.Position = new CCPoint(size.Width / 2 - 100, 30);
            item2.Position = new CCPoint(size.Width / 2, 30);
            item3.Position = new CCPoint(size.Width / 2 + 100, 30);

            AddChild(menu, 1);

            Schedule(checkAnim);
        }
开发者ID:KogleDK,项目名称:cocos2d-xna-1,代码行数:56,代码来源:TextLayer.cs


示例19: labelWithString

        /// <summary>
        /// creates a CCLabelTTF from a fontname, alignment, dimension and font size
        /// </summary>
        public static CCLabelTTF labelWithString(string label, CCSize dimensions, CCTextAlignment alignment, string fontName, float fontSize)
        {
            CCLabelTTF pRet = new CCLabelTTF();
            if (pRet != null && pRet.initWithString(label, dimensions, alignment, fontName, fontSize))
            {
                return pRet;
            }

            return null;
        }
开发者ID:liwq-net,项目名称:cocos2d-for-xna-windows,代码行数:13,代码来源:CCLabelTTF.cs


示例20: labelWithString

        /// <summary>
        /// creates a CCLabelTTF from a fontname and font size
        /// </summary>
        public static CCLabelTTF labelWithString(string label, string fontName, float fontSize)
        {
            CCLabelTTF pRet = new CCLabelTTF();
            if (pRet.initWithString(label, fontName, fontSize))
            {
                return pRet;
            }

            return null;
        }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:13,代码来源:CCLabelTTF.cs



注:本文中的cocos2d.CCLabelTTF类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# cocos2d.CCNode类代码示例发布时间:2022-05-26
下一篇:
C# cocos2d.CCBReader类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap