2020-08-04 12:31:33 +08:00
|
|
|
#ifndef __GEARXY_H__
|
|
|
|
#define __GEARXY_H__
|
|
|
|
|
|
|
|
#include "FairyGUIMacros.h"
|
|
|
|
#include "GearBase.h"
|
|
|
|
#include "cocos2d.h"
|
|
|
|
|
|
|
|
NS_FGUI_BEGIN
|
|
|
|
|
|
|
|
class GObject;
|
|
|
|
class GTweener;
|
|
|
|
|
|
|
|
class GearXY : public GearBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GearXY(GObject* owner);
|
|
|
|
virtual ~GearXY();
|
|
|
|
|
|
|
|
void apply() override;
|
|
|
|
void updateState() override;
|
|
|
|
void updateFromRelations(float dx, float dy) override;
|
|
|
|
|
|
|
|
bool positionsInPercent;
|
|
|
|
void addExtStatus(const std::string& pageId, ByteBuffer* buffer);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void addStatus(const std::string& pageId, ByteBuffer* buffer) override;
|
|
|
|
void init() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void onTweenUpdate(GTweener* tweener);
|
|
|
|
void onTweenComplete();
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
std::unordered_map<std::string, axis::Vec4> _storage;
|
|
|
|
axis::Vec4 _default;
|
2020-08-04 12:31:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_FGUI_END
|
|
|
|
|
|
|
|
#endif
|