mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
Clean up.
This commit is contained in:
parent
b7ac58b0d2
commit
35b45a564b
@ -42,7 +42,6 @@ bool ExampleLayer::init () {
|
||||
if (!CCLayer::init()) return false;
|
||||
|
||||
skeletonNode = new CCSkeletonAnimation("spineboy.json", "spineboy.atlas");
|
||||
skeletonNode->addAnimationState();
|
||||
skeletonNode->setMix("walk", "jump", 0.2f);
|
||||
skeletonNode->setMix("jump", "walk", 0.4f);
|
||||
|
||||
|
||||
@ -219,11 +219,7 @@ CCRect CCSkeleton::boundingBox () {
|
||||
maxY = max(maxY, quad.tr.vertices.y * scaleY);
|
||||
}
|
||||
CCPoint position = getPosition();
|
||||
minX = position.x + minX;
|
||||
minY = position.y + minY;
|
||||
maxX = position.x + maxX;
|
||||
maxY = position.y + maxY;
|
||||
return CCRectMake(minX, minY, maxX - minX, maxY - minY);
|
||||
return CCRectMake(position.x + minX, position.y + minY, maxX - minX, maxY - minY);
|
||||
}
|
||||
|
||||
// CCBlendProtocol
|
||||
|
||||
@ -54,14 +54,17 @@ CCSkeletonAnimation* CCSkeletonAnimation::createWithFile (const char* skeletonDa
|
||||
|
||||
CCSkeletonAnimation::CCSkeletonAnimation (SkeletonData *skeletonData)
|
||||
: CCSkeleton(skeletonData) {
|
||||
addAnimationState();
|
||||
}
|
||||
|
||||
CCSkeletonAnimation::CCSkeletonAnimation (const char* skeletonDataFile, Atlas* atlas, float scale)
|
||||
: CCSkeleton(skeletonDataFile, atlas, scale) {
|
||||
addAnimationState();
|
||||
}
|
||||
|
||||
CCSkeletonAnimation::CCSkeletonAnimation (const char* skeletonDataFile, const char* atlasFile, float scale)
|
||||
: CCSkeleton(skeletonDataFile, atlasFile, scale) {
|
||||
addAnimationState();
|
||||
}
|
||||
|
||||
CCSkeletonAnimation::~CCSkeletonAnimation () {
|
||||
@ -113,7 +116,7 @@ void CCSkeletonAnimation::setAnimationStateData (AnimationStateData* stateData,
|
||||
AnimationState_dispose(state);
|
||||
|
||||
state = AnimationState_create(stateData);
|
||||
states.push_back(state);
|
||||
states[stateIndex] = state;
|
||||
}
|
||||
|
||||
void CCSkeletonAnimation::setMix (char* fromAnimation, char* toAnimation, float duration, int stateIndex) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user