udpate for ui button state change event

This commit is contained in:
Liam 2014-10-27 11:16:25 +08:00
parent 57e6631918
commit 19ed3d1965
1 changed files with 18 additions and 1 deletions

View File

@ -435,7 +435,15 @@ void Button::onPressStateChangedToNormal()
_buttonClickedRenderer->setScale(_pressedTextureScaleXInSize, _pressedTextureScaleYInSize);
_titleRenderer->stopAllActions();
_titleRenderer->runAction(zoomAction->clone());
if (_unifySize)
{
Action *zoomTitleAction = ScaleTo::create(ZOOM_ACTION_TIME_STEP, 1, 1);
_titleRenderer->runAction(zoomTitleAction);
}
else
{
_titleRenderer->runAction(zoomAction->clone());
}
}
}
else
@ -483,6 +491,15 @@ void Button::onPressStateChangedToPressed()
_titleRenderer->stopAllActions();
//we must call zoomAction->clone here
_titleRenderer->runAction(zoomAction->clone());
if (_unifySize)
{
Action *zoomTitleAction = ScaleTo::create(ZOOM_ACTION_TIME_STEP, 1 + _zoomScale, 1 + _zoomScale);
_titleRenderer->runAction(zoomTitleAction);
}
else
{
_titleRenderer->runAction(zoomAction->clone());
}
}
}
else