cocos2dx v3.x 设置Button的不可用图片

在v3.x版本中,直接使用Button的setTouchEnable(false),并不能直接显示按钮的不可用图片,需要做额外的操作:

1. 设置Button的不可用图片

testButton->loadTextureDisabled( "testDisable.png" );

2. 同时设置不可触摸和不可高亮

testButton->setBright( false );
testButton->setTouchEnabled( false );

猜你喜欢

转载自blog.csdn.net/woodengm/article/details/40616645
今日推荐