axmol/cocos/editor-support/cocostudio/CCDatas.h

555 lines
12 KiB
C
Raw Normal View History

2015-06-17 13:16:06 +08:00
/****************************************************************************
Copyright (c) 2013-2014 Chukong Technologies Inc.
2013-06-06 12:02:54 +08:00
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CCARMATURE_DATAS_H__
#define __CCARMATURE_DATAS_H__
2013-06-06 12:02:54 +08:00
#include "base/CCRef.h"
2014-04-30 08:37:36 +08:00
#include "base/ccTypes.h"
2014-04-27 01:35:57 +08:00
#include "base/CCVector.h"
#include "base/CCMap.h"
2014-04-30 08:37:36 +08:00
#include "math/CCAffineTransform.h"
#include "cocostudio/CCArmatureDefine.h"
#include "2d/CCTweenFunction.h"
#include "cocostudio/CocosStudioExport.h"
2013-06-06 12:02:54 +08:00
2013-09-13 18:07:37 +08:00
#define CC_CREATE_NO_PARAM_NO_INIT(varType)\
2013-06-06 12:02:54 +08:00
public: \
2015-06-17 13:16:06 +08:00
static inline varType *create(void){ \
varType *var = new (std::nothrow) varType();\
2015-06-17 13:16:06 +08:00
if (var)\
2013-06-06 12:02:54 +08:00
{\
2015-06-17 13:16:06 +08:00
var->autorelease();\
return var;\
2013-06-06 12:02:54 +08:00
}\
2015-06-17 13:16:06 +08:00
CC_SAFE_DELETE(var);\
return nullptr;\
2013-06-06 12:02:54 +08:00
}
2013-09-13 18:07:37 +08:00
#define CC_CREATE_NO_PARAM(varType)\
2013-06-06 12:02:54 +08:00
public: \
2015-06-17 13:16:06 +08:00
static inline varType *create(void){ \
varType *var = new (std::nothrow) varType();\
2015-06-17 13:16:06 +08:00
if (var && var->init())\
2013-06-06 12:02:54 +08:00
{\
2015-06-17 13:16:06 +08:00
var->autorelease();\
return var;\
2013-06-06 12:02:54 +08:00
}\
2015-06-17 13:16:06 +08:00
CC_SAFE_DELETE(var);\
return nullptr;\
2013-06-06 12:02:54 +08:00
}
namespace cocostudio {
2013-06-07 10:52:32 +08:00
2013-06-06 12:02:54 +08:00
/**
* The base node include a lot of attributes.
* @js NA
* @lua NA
*/
class CC_STUDIO_DLL BaseData : public cocos2d::Ref
2013-06-06 12:02:54 +08:00
{
public:
CC_CREATE_NO_PARAM_NO_INIT(BaseData)
2013-06-07 10:52:32 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
BaseData();
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
~BaseData(void);
2013-06-07 10:52:32 +08:00
/*
2013-09-13 18:07:37 +08:00
* Copy data from node
* @param node A BaseData to copy data
2013-06-07 10:52:32 +08:00
*/
virtual void copy(const BaseData *node);
2013-06-07 10:52:32 +08:00
/*
* Calculate two BaseData's between value(to - from) and set to self
2013-06-07 10:52:32 +08:00
*
* @param from from BaseData
* @param to to BaseData
2013-06-07 10:52:32 +08:00
*/
virtual void subtract(BaseData *from, BaseData *to, bool limit);
2013-09-13 18:07:37 +08:00
virtual void setColor(const cocos2d::Color4B &color);
virtual cocos2d::Color4B getColor();
2013-06-07 10:52:32 +08:00
public:
2015-06-17 13:16:06 +08:00
float x; //! position x attribute
float y; //! position y attribute
int zOrder; //! zorder attribute, used to order the Bone's depth order
2013-06-07 19:48:31 +08:00
2013-06-07 10:52:32 +08:00
/**
* x y skewX skewY scaleX scaleY used to calculate transform matrix
* skewX, skewY can have rotation effect
* To get more matrix information, you can have a look at this pape : http://www.senocular.com/flash/tutorials/transformmatrix/
*/
float skewX;
float skewY;
float scaleX;
float scaleY;
2013-09-13 18:07:37 +08:00
float tweenRotate; //! SkewX, SkewY, and TweenRotate effect the rotation
2013-06-07 10:52:32 +08:00
2013-09-13 18:07:37 +08:00
bool isUseColorInfo; //! Whether or not this frame have the color changed Info
2013-06-07 10:52:32 +08:00
int a, r, g, b;
2013-06-06 12:02:54 +08:00
};
2013-06-06 12:02:54 +08:00
/**
2013-09-13 18:07:37 +08:00
* DisplayType distinguish which type your display is.
2013-06-06 12:02:54 +08:00
*/
2013-06-07 10:52:32 +08:00
enum DisplayType
{
2013-09-13 18:07:37 +08:00
CS_DISPLAY_SPRITE, //! display is a single Sprite
CS_DISPLAY_ARMATURE, //! display is a Armature
2013-09-13 18:07:37 +08:00
CS_DISPLAY_PARTICLE, //! display is a CCParticle.
2013-06-06 12:02:54 +08:00
2013-06-07 10:52:32 +08:00
CS_DISPLAY_MAX
2013-06-06 12:02:54 +08:00
};
/**
* @js NA
* @lua NA
*/
class CC_STUDIO_DLL DisplayData : public cocos2d::Ref
2013-06-06 12:02:54 +08:00
{
public:
CC_CREATE_NO_PARAM_NO_INIT(DisplayData)
2013-06-06 12:02:54 +08:00
2013-12-25 19:46:09 +08:00
static const std::string changeDisplayToTexture(const std::string& displayName);
2013-06-06 12:02:54 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
DisplayData();
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
virtual ~DisplayData(void) {}
virtual void copy(DisplayData *displayData);
2013-06-06 12:02:54 +08:00
2015-06-17 13:16:06 +08:00
DisplayType displayType; //! mark which type your display is
std::string displayName;
2013-06-06 12:02:54 +08:00
};
/**
* @js NA
* @lua NA
*/
class CC_STUDIO_DLL SpriteDisplayData : public DisplayData
2013-06-06 12:02:54 +08:00
{
public:
CC_CREATE_NO_PARAM_NO_INIT(SpriteDisplayData)
2013-06-06 12:02:54 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
SpriteDisplayData();
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
virtual ~SpriteDisplayData() {};
2013-06-06 12:02:54 +08:00
void copy(DisplayData *displayData);
2013-06-06 12:02:54 +08:00
public:
BaseData skinData;
2013-06-06 12:02:54 +08:00
};
/**
* @js NA
* @lua NA
*/
class CC_STUDIO_DLL ArmatureDisplayData : public DisplayData
2013-06-07 10:52:32 +08:00
{
2013-06-06 12:02:54 +08:00
public:
CC_CREATE_NO_PARAM_NO_INIT(ArmatureDisplayData)
2013-06-06 12:02:54 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
ArmatureDisplayData();
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
virtual ~ArmatureDisplayData() {}
2013-06-06 12:02:54 +08:00
};
/**
* @js NA
* @lua NA
*/
class CC_STUDIO_DLL ParticleDisplayData : public DisplayData
2013-06-06 12:02:54 +08:00
{
public:
CC_CREATE_NO_PARAM_NO_INIT(ParticleDisplayData)
2013-06-06 12:02:54 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
ParticleDisplayData();
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
virtual ~ParticleDisplayData() {};
2013-06-06 12:02:54 +08:00
};
/**
* BoneData used to init a Bone.
* BoneData keeps a DisplayData list, a Bone can have many display to change.
* The display information saved in the DisplayData
* @js NA
* @lua NA
2013-06-06 12:02:54 +08:00
*/
class CC_STUDIO_DLL BoneData : public BaseData
2013-06-06 12:02:54 +08:00
{
public:
CC_CREATE_NO_PARAM(BoneData)
2013-06-06 12:02:54 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
BoneData(void);
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
~BoneData(void);
2013-06-06 12:02:54 +08:00
2013-06-07 10:52:32 +08:00
virtual bool init();
2013-06-06 12:02:54 +08:00
void addDisplayData(DisplayData *displayData);
DisplayData *getDisplayData(int index);
2013-06-06 12:02:54 +08:00
public:
2013-09-13 18:07:37 +08:00
std::string name; //! the bone's name
std::string parentName; //! the bone parent's name
2013-12-13 19:40:38 +08:00
cocos2d::Vector<DisplayData*> displayDataList; //! save DisplayData informations for the Bone
cocos2d::AffineTransform boneDataTransform;
2013-06-06 12:02:54 +08:00
};
2013-06-06 12:02:54 +08:00
/**
* ArmatureData saved the Armature name and Bonedata needed for the CCBones in this Armature
* When we create a Armature, we need to get each Bone's BoneData as it's init information.
* So we can get a BoneData from the Dictionary saved in the ArmatureData.
* @js NA
* @lua NA
2013-06-06 12:02:54 +08:00
*/
class CC_STUDIO_DLL ArmatureData : public cocos2d::Ref
2013-06-06 12:02:54 +08:00
{
public:
CC_CREATE_NO_PARAM(ArmatureData)
2013-06-06 12:02:54 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
ArmatureData();
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
~ArmatureData();
2013-06-06 12:02:54 +08:00
2013-06-07 10:52:32 +08:00
bool init();
void addBoneData(BoneData *boneData);
BoneData *getBoneData(const std::string& boneName);
2013-06-06 12:02:54 +08:00
public:
2013-06-07 10:52:32 +08:00
std::string name;
2013-12-13 19:40:38 +08:00
cocos2d::Map<std::string, BoneData*> boneDataDic;
2013-09-13 18:07:37 +08:00
float dataVersion;
};
enum BlendType
2013-09-13 18:07:37 +08:00
{
BLEND_NORMAL,
BLEND_LAYER,
BLEND_DARKEN,
BLEND_MULTIPLY,
BLEND_LIGHTEN,
BLEND_SCREEN,
BLEND_OVERLAY,
BLEND_HARD_LIGHT,
BLEND_ADD,
BLEND_SUBSTRACT,
BLEND_DIFFERENCE,
BLEND_INVERT,
BLEND_ALPHA,
BLEND_ERASE
2013-06-06 12:02:54 +08:00
};
/**
* @js NA
* @lua NA
*/
class CC_STUDIO_DLL FrameData : public BaseData
2013-06-06 12:02:54 +08:00
{
public:
CC_CREATE_NO_PARAM_NO_INIT(FrameData)
2013-06-06 12:02:54 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
FrameData();
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
~FrameData();
2013-06-06 12:02:54 +08:00
virtual void copy(const BaseData *baseData);
2013-06-06 12:02:54 +08:00
public:
2013-09-13 18:07:37 +08:00
int frameID;
int duration; //! The frame will last duration frames
cocos2d::tweenfunc::TweenType tweenEasing; //! Every frame's tween easing effect
int easingParamNumber;
float *easingParams;
2013-09-17 20:14:08 +08:00
bool isTween; //! Whether it's a tween key frame
2013-06-06 12:02:54 +08:00
2013-06-07 10:52:32 +08:00
/**
* The current display index when change to this frame.
2013-09-13 18:07:37 +08:00
* If value is -1, then display will not be shown.
2013-06-07 10:52:32 +08:00
*/
int displayIndex;
2013-06-06 12:02:54 +08:00
cocos2d::BlendFunc blendFunc;
2013-09-13 18:07:37 +08:00
std::string strEvent;
2013-06-07 10:52:32 +08:00
/**
2013-09-13 18:07:37 +08:00
* strMovement, strEvent, strSound, strSoundEffect do not support yet
2013-06-07 10:52:32 +08:00
*/
2013-09-13 18:07:37 +08:00
std::string strMovement;
std::string strSound;
std::string strSoundEffect;
2013-06-06 12:02:54 +08:00
};
/**
* @js NA
* @lua NA
*/
class CC_STUDIO_DLL MovementBoneData : public cocos2d::Ref
2013-06-06 12:02:54 +08:00
{
public:
CC_CREATE_NO_PARAM(MovementBoneData)
2013-06-06 12:02:54 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
MovementBoneData();
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
~MovementBoneData(void);
2013-06-06 12:02:54 +08:00
2013-06-07 10:52:32 +08:00
virtual bool init();
2013-06-06 12:02:54 +08:00
void addFrameData(FrameData *frameData);
FrameData *getFrameData(int index);
2013-06-06 12:02:54 +08:00
public:
2013-09-13 18:07:37 +08:00
float delay; //! movement delay percent, this value can produce a delay effect
float scale; //! scale this movement
float duration; //! this Bone in this movement will last m_iDuration frames
2013-09-13 18:07:37 +08:00
std::string name; //! bone name
2013-06-06 12:02:54 +08:00
2013-12-13 19:40:38 +08:00
cocos2d::Vector<FrameData*> frameList;
2013-06-06 12:02:54 +08:00
};
/**
* @js NA
* @lua NA
*/
class CC_STUDIO_DLL MovementData : public cocos2d::Ref
2013-06-06 12:02:54 +08:00
{
public:
CC_CREATE_NO_PARAM_NO_INIT(MovementData)
2013-06-07 10:52:32 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
MovementData(void);
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
~MovementData(void);
2013-06-07 10:52:32 +08:00
void addMovementBoneData(MovementBoneData *movBoneData);
MovementBoneData *getMovementBoneData(const std::string& boneName);
2013-06-07 10:52:32 +08:00
public:
std::string name;
int duration; //! the frames this movement will last
2015-06-17 13:16:06 +08:00
float scale; //! scale this movement
2013-06-07 10:52:32 +08:00
/**
2013-09-13 18:07:37 +08:00
* Change to this movement will last durationTo frames. Use this effect can avoid too suddenly changing.
2013-06-07 10:52:32 +08:00
*
2013-09-13 18:07:37 +08:00
* Example : current movement is "stand", we want to change to "run", then we fill durationTo frames before
2013-06-07 10:52:32 +08:00
* change to "run" instead of changing to "run" directly.
*/
int durationTo;
/*
2013-09-13 18:07:37 +08:00
* This is different from duration, durationTween contain tween effect.
* duration is the raw time that the animation will last, it's the same with the time you edit in the Action Editor.
* durationTween is the actual time you want this animation last.
* Example : If we edit 10 frames in the flash, then duration is 10. When we set durationTween to 50, the movement will last 50 frames, the extra 40 frames will auto filled with tween effect
2013-06-07 10:52:32 +08:00
*/
int durationTween;
2013-09-13 18:07:37 +08:00
bool loop; //! whether the movement was looped
2013-06-07 19:48:31 +08:00
2013-06-07 10:52:32 +08:00
/**
* Which tween easing effect the movement use
* TWEEN_EASING_MAX : use the value from MovementData get from flash design panel
2013-06-07 10:52:32 +08:00
*/
cocos2d::tweenfunc::TweenType tweenEasing;
2013-06-07 10:52:32 +08:00
/**
2015-06-17 13:16:06 +08:00
* @brief save movment bone data
* @key const std::string&
* @value MovementBoneData *
2013-09-13 18:07:37 +08:00
*/
2013-12-13 19:40:38 +08:00
cocos2d::Map<std::string, MovementBoneData*> movBoneDataDic;
2013-06-06 12:02:54 +08:00
};
2013-06-06 12:02:54 +08:00
/**
* AnimationData include all movement information for the Armature
* The struct is AnimationData -> MovementData -> MovementBoneData -> FrameData
2013-06-06 12:02:54 +08:00
* -> MovementFrameData
* @js NA
* @lua NA
2013-06-06 12:02:54 +08:00
*/
class CC_STUDIO_DLL AnimationData : public cocos2d::Ref
2013-06-06 12:02:54 +08:00
{
public:
CC_CREATE_NO_PARAM_NO_INIT(AnimationData)
2013-06-06 12:02:54 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
AnimationData(void);
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
~AnimationData(void);
2013-06-06 12:02:54 +08:00
void addMovement(MovementData *movData);
MovementData *getMovement(const std::string& movementName);
2013-12-18 22:07:33 +08:00
ssize_t getMovementCount();
2013-06-06 12:02:54 +08:00
public:
2013-06-07 10:52:32 +08:00
std::string name;
2013-12-13 19:40:38 +08:00
cocos2d::Map<std::string, MovementData*> movementDataDic;
2013-06-07 10:52:32 +08:00
std::vector<std::string> movementNames;
2013-06-06 12:02:54 +08:00
};
2013-06-06 12:02:54 +08:00
/*
* ContourData include a contour vertex information
* @js NA
* @lua NA
2013-06-06 12:02:54 +08:00
*/
class CC_STUDIO_DLL ContourData : public cocos2d::Ref
2013-06-06 12:02:54 +08:00
{
public:
CC_CREATE_NO_PARAM(ContourData)
2013-06-06 12:02:54 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
ContourData();
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
~ContourData(void);
2013-06-06 12:02:54 +08:00
2013-06-07 10:52:32 +08:00
virtual bool init();
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
virtual void addVertex(cocos2d::Vec2 &vertex);
2013-06-06 12:02:54 +08:00
public:
2015-06-17 13:16:06 +08:00
std::vector<cocos2d::Vec2> vertexList; //! Save contour vertex info, vertex saved in a Vec2
2013-06-06 12:02:54 +08:00
};
/*
* TextureData include a texture's information
* @js NA
* @lua NA
2013-06-06 12:02:54 +08:00
*/
class CC_STUDIO_DLL TextureData : public cocos2d::Ref
2013-06-06 12:02:54 +08:00
{
public:
CC_CREATE_NO_PARAM(TextureData)
2013-06-06 12:02:54 +08:00
public:
2015-06-17 13:16:06 +08:00
/**
2013-09-16 14:13:55 +08:00
* @js ctor
*/
TextureData();
2013-09-16 14:13:55 +08:00
/**
* @js NA
* @lua NA
*/
~TextureData(void);
2013-06-06 12:02:54 +08:00
2013-06-07 10:52:32 +08:00
virtual bool init();
2013-06-06 12:02:54 +08:00
void addContourData(ContourData *contourData);
ContourData *getContourData(int index);
2013-06-06 12:02:54 +08:00
public:
2013-06-07 19:48:31 +08:00
2015-06-17 13:16:06 +08:00
float height; //! The texture's width, height
float width;
2013-06-06 12:02:54 +08:00
2015-06-17 13:16:06 +08:00
float pivotX; //! The texture's anchor point
2013-06-07 10:52:32 +08:00
float pivotY;
2013-06-06 12:02:54 +08:00
2015-06-17 13:16:06 +08:00
std::string name; //! The texture's name
2013-06-06 12:02:54 +08:00
2013-12-13 19:40:38 +08:00
cocos2d::Vector<ContourData*> contourDataList;
2013-06-06 12:02:54 +08:00
};
2013-06-06 12:02:54 +08:00
}
2013-06-06 12:02:54 +08:00
#endif /*__CCARMATURE_DATAS_H__*/