CLabelAtlas* TuiManager::createLabelAtlas(float tag, const char* num, const char* imgPath,float x,float y,float w,float h,float rotation){ CLabelAtlas *pLabAtlas = CLabelAtlas::create(num, imgPath, w / 12, h, 48); pLabAtlas->setRotation(rotation); pLabAtlas->setPosition(Vec2(x,-y)); pLabAtlas->setTag(tag); return pLabAtlas; }
bool CLabelAtlasTest::init() { CLabelTestSceneBase::init(); setTitle("CLabelBasicTest"); setDescription("CLabelAtlas extern CCLabelAtlas (test event)"); CLabelAtlas* pText = CLabelAtlas::create(":;0123456789", "num.png", 26, 34, 48); pText->setTouchEnabled(true); pText->setAnchorPoint(Vec2(0.5, 0.5)); pText->setPosition(Vec2(480, 320)); pText->setOnTouchBeganListener(this, ccw_touchbegan_selector(CLabelAtlasTest::onTouchBegan)); pText->setOnTouchEndedListener(this, ccw_touchevent_selector(CLabelAtlasTest::onTouchEnded)); pText->setOnTouchCancelledListener(this, ccw_touchevent_selector(CLabelAtlasTest::onTouchEnded)); m_pWindow->addChild(pText); return true; }
CLabelAtlas* TuiManager::createLabelAtlas(float tag,const char* imgPath,float x,float y,float w,float h,float rotation){ CLabelAtlas *pLabAtlas = CLabelAtlas::create("123456",imgPath,w/12,h,48); pLabAtlas->setPosition(Point(x,-y)); pLabAtlas->setTag(tag); return pLabAtlas; }