Merge pull request #5058 from zhiqiangxu/develop

ScrollView should implement ActionTweenDelegate
This commit is contained in:
James Chen 2014-02-20 20:33:04 +08:00
commit e59a14f205
2 changed files with 10 additions and 1 deletions

View File

@ -310,6 +310,11 @@ void ScrollView::setZoomScaleInDuration(float s, float dt)
}
}
void ScrollView::updateTweenAction(float value, const std::string& key)
{
this->setZoomScale(value);
}
void ScrollView::setViewSize(Size size)
{
_viewSize = size;

View File

@ -65,7 +65,7 @@ public:
* ScrollView support for cocos2d-x.
* It provides scroll view functionalities to cocos2d projects natively.
*/
class ScrollView : public Layer
class ScrollView : public Layer, public ActionTweenDelegate
{
public:
enum class Direction
@ -230,6 +230,10 @@ public:
using Node::addChild;
virtual void addChild(Node * child, int zOrder, int tag) override;
/**
* CCActionTweenDelegate
*/
void updateTweenAction(float value, const std::string& key);
protected:
/**
* Relocates the container at the proper offset, in bounds of max/min offsets.