——————
class LogoInLayer : public cocos2d::CCLayer
{
public:
void onEnter();
void onExit();
void registerWithTouchDispatcher();
bool ccTouchBegan(CCTouch* pTouch, CCEvent* event);
void ccTouchEnded(CCTouch* pTouch, CCEvent* event);
void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent);
void keyMenuClicked();
void keyBackClicked();
};
缩略语 我设立了CCText FieldTTF协调人,并确定:
CCTextFieldTTF * l = CCTextFieldTTF::textFieldWithPlaceHolder("12345567", "", 25);
l->setPosition(ccp(200,200));
addChild(l, 5,1234);
this->setIsTouchEnabled(true);
this->setIsKeypadEnabled(true);
————————————
void LogoInLayer::registerWithTouchDispatcher()
{
CCTouchDispatcher::sharedDispatcher()
->addTargetedDelegate(this, kCCMenuTouchPriority + 2, true);
}
——4
CCTextFieldTTF* l = (CCTextFieldTTF*)this->getChildByTag(1234);
l->attachWithIME();
我会发现任何错误,但即便是,当跑时,也可以在跳板上打开钥匙板。