diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 5b707a07b9..0137a6bfe7 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -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; diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index 8ab06f01f7..ad08140523 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -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.