在cocos2dx3.1中Button的三种状态中Disable状态的显示改为如下:
auto btnUpdate = Button::create("UI/ShopScene/btnUpdate.png","UI/ShopScene/btnUpdate_press.png","UI/ShopScene/btnUpdate_press.png");
btnUpdate->addTouchEventListener(CC_CALLBACK_2(ShopLayer::touchEvent,this));
btnUpdate->setBright(false);
btnUpdate->setEnabled(false);
setBright(false)是显示禁用状态下的帧,setEnable(false)只是屏蔽触摸事件。
本文介绍如何在Cocos2dx 3.1中设置Button的禁用状态,通过使用setBright(false)来显示禁用状态的帧,并使用setEnable(false)屏蔽触摸事件。
1万+

被折叠的 条评论
为什么被折叠?



