界面上 放一个按钮,点击一下,按钮变大一下,我的代码如下,可是没有得到我想要的效果,它缩放是从左下角开始的,我想要缩放是从中间开始的,设置过锚点,spriteNormal->setAnchorPoint(Point(0.5, 0.5));,可是没用,求高手帮助
1 auto menu = Menu::create(); 2 3 auto spriteNormal = Sprite::create(s_pathSettingBtnOk); 4 spriteNormal->setScale(0.5, 0.5); 5 auto spriteSelected = Sprite::create(s_pathSettingBtnOk); 6 7 auto settingBtnOkItem = MenuItemSprite::create(spriteNormal, spriteSelected, nullptr, CC_CALLBACK_1(SettingLayer::settingBtnOkCallback, this)); 8 settingBtnOkItem->setPosition(Point(this->winSize.width / 2, this->winSize.height / 2)); 9 menu->addChild(settingBtnOkItem); 10 11 menu->setPosition(Point(0, 0)); 12 this->addChild(menu);
请我博主怎么解决这个问题的?