CCScrollView should inherit CCActionTweenDelegate

This commit is contained in:
xuzhiqiang 2014-01-14 20:03:12 +08:00
parent e8f55069e3
commit 562fdcf98b
2 changed files with 10 additions and 1 deletions

View File

@ -300,6 +300,11 @@ void ScrollView::setZoomScaleInDuration(float s, float dt)
} }
} }
void CCScrollView::updateTweenAction(float value, const char* key)
{
setZoomScale(value);
}
void ScrollView::setViewSize(Size size) void ScrollView::setViewSize(Size size)
{ {
_viewSize = size; _viewSize = size;

View File

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