public LabelAtlasColorTest()
        {
            CCLabelAtlas label1 = CCLabelAtlas.labelWithString("123 Test", "fonts/tuffy_bold_italic-charmap.png", 48, 64, ' ');

            addChild(label1, 0, (int)TagSprite.kTagSprite1);
            label1.position = new CCPoint(10, 100);
            label1.Opacity  = 200;

            CCLabelAtlas label2 = CCLabelAtlas.labelWithString("0123456789", "fonts/tuffy_bold_italic-charmap.png", 48, 64, ' ');

            addChild(label2, 0, (int)TagSprite.kTagSprite2);
            label2.position = new CCPoint(10, 200);
            //label2.setColor( ccRED );
            label2.Color = ccRED;

            CCActionInterval fade = CCFadeOut.actionWithDuration(1.0f);
            //CCActionInterval fade_in = fade.reverse();
            CCActionInterval   fade_in = null;
            CCFiniteTimeAction seq     = CCSequence.actions(fade, fade_in, null);
            CCAction           repeat  = CCRepeatForever.actionWithAction((CCActionInterval)seq);

            label2.runAction(repeat);

            m_time = 0;

            //schedule( schedule_selector(LabelAtlasColorTest.step) ); //:@selector(step:)];
        }
Beispiel #2
0
        // CCLayer
        public override void onEnter()
        {
            base.onEnter();

            m_nCharLimit = 12;

            m_pTextFieldAction = CCRepeatForever.actionWithAction(
                (CCActionInterval)CCSequence.actions(
                    CCFadeOut.actionWithDuration(0.25f),
                    CCFadeIn.actionWithDuration(0.25f)));
            //m_pTextFieldAction->retain();
            m_bAction = false;

            // add CCTextFieldTTF
            CCSize s = CCDirector.sharedDirector().getWinSize();

            m_pTextField = CCTextFieldTTF.textFieldWithPlaceHolder("<click here for input>",
                                                                   TextInputTestScene.FONT_NAME, TextInputTestScene.FONT_SIZE);
            addChild(m_pTextField);

            //m_pTextField.setDelegate(this);


            //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
            //    // on android, CCTextFieldTTF cannot auto adjust its position when soft-keyboard pop up
            //    // so we had to set a higher position
            //    m_pTextField->setPosition(new CCPoint(s.width / 2, s.height/2 + 50));
            //#else
            //    m_pTextField->setPosition(ccp(s.width / 2, s.height / 2));
            //#endif

            m_pTrackNode = m_pTextField;
        }
        public Atlas4()
        {
            m_time = 0;

            // Upper Label
            CCLabelBMFont label = CCLabelBMFont.labelWithString("Bitmap Font Atlas", "fonts/bitmapFontTest.fnt");

            addChild(label);

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

            label.position    = new CCPoint(s.width / 2, s.height / 2);
            label.anchorPoint = new CCPoint(0.5f, 0.5f);


            CCSprite BChar = (CCSprite)label.getChildByTag(1);
            CCSprite FChar = (CCSprite)label.getChildByTag(7);
            CCSprite AChar = (CCSprite)label.getChildByTag(12);


            CCActionInterval rotate    = CCRotateBy.actionWithDuration(2, 360);
            CCAction         rot_4ever = CCRepeatForever.actionWithAction(rotate);

            CCActionInterval scale = CCScaleBy.actionWithDuration(2, 1.5f);
            //CCActionInterval scale_back = scale.reverse();
            CCActionInterval   scale_back  = null;
            CCFiniteTimeAction scale_seq   = CCSequence.actions(scale, scale_back, null);
            CCAction           scale_4ever = CCRepeatForever.actionWithAction((CCActionInterval)scale_seq);

            CCActionInterval jump       = CCJumpBy.actionWithDuration(0.5f, new CCPoint(), 60, 1);
            CCAction         jump_4ever = CCRepeatForever.actionWithAction(jump);

            CCActionInterval   fade_out   = CCFadeOut.actionWithDuration(1);
            CCActionInterval   fade_in    = CCFadeIn.actionWithDuration(1);
            CCFiniteTimeAction seq        = CCSequence.actions(fade_out, fade_in, null);
            CCAction           fade_4ever = CCRepeatForever.actionWithAction((CCActionInterval)seq);

            BChar.runAction(rot_4ever);
            BChar.runAction(scale_4ever);
            FChar.runAction(jump_4ever);
            AChar.runAction(fade_4ever);


            // Bottom Label
            CCLabelBMFont label2 = CCLabelBMFont.labelWithString("00.0", "fonts/bitmapFontTest.fnt");

            addChild(label2, 0, (int)TagSprite.kTagBitmapAtlas2);
            label2.position = new CCPoint(s.width / 2.0f, 80);

            CCSprite lastChar = (CCSprite)label2.getChildByTag(3);

            lastChar.runAction((CCAction)(rot_4ever.copy()));

            //schedule( schedule_selector(Atlas4::step), 0.1f);
            base.schedule(step, 0.1f);
        }
Beispiel #4
0
 public override CCFiniteTimeAction reverse()
 {
     return(CCRepeatForever.actionWithAction(m_pInnerAction.reverse() as CCActionInterval));
 }