CImageView *TuiManager::createImage(float tag, const char* file, float scaleX, float scaleY,float x, float y, float rotation){ CImageView *pImg = m_isUseSpriteFrame ? CImageView::createWithSpriteFrameName(file) : CImageView::create(file); Size size = pImg->getContentSize(); pImg->setPosition(Point(x,-y)); pImg->setScale(scaleX, scaleY); pImg->setRotation(rotation); pImg->setTag(tag); return pImg; }
CImageView *TuiManager::createImage(float tag, const char* file, float scaleX, float scaleY, int flipX, int flipY, float x, float y, float rotation, int isUseFrame){ CImageView *pImg = isUseFrame ? CImageView::createWithSpriteFrameName(file) : CImageView::create(file); Size size = pImg->getContentSize(); pImg->setPosition(Vec2(x,-y)); pImg->setFlippedX(flipX == 1); pImg->setFlippedY(flipY == 1); pImg->setScale(scaleX, scaleY); pImg->setRotation(rotation); pImg->setTag(tag); return pImg; }