mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
Made 0 scale use "content scale factor". Commented drawOrder animation.
This commit is contained in:
parent
284ac9a5be
commit
6862eec5af
@ -14,7 +14,8 @@
|
||||
self = [super init];
|
||||
if (!self) return nil;
|
||||
|
||||
animationNode = [CCSkeletonAnimation skeletonWithFile:@"spineboy.json" atlasFile:@"spineboy.atlas" scale:1];
|
||||
// A scale of zero will use 1 / CC_CONTENT_SCALE_FACTOR().
|
||||
animationNode = [CCSkeletonAnimation skeletonWithFile:@"spineboy.json" atlasFile:@"spineboy.atlas" scale:0];
|
||||
[animationNode setMixFrom:@"walk" to:@"jump" duration:0.2f];
|
||||
[animationNode setMixFrom:@"jump" to:@"walk" duration:0.4f];
|
||||
[animationNode setDelegate:self];
|
||||
@ -22,7 +23,7 @@
|
||||
[animationNode addAnimationForTrack:0 name:@"jump" loop:NO afterDelay:0];
|
||||
[animationNode addAnimationForTrack:0 name:@"walk" loop:YES afterDelay:0];
|
||||
[animationNode addAnimationForTrack:0 name:@"jump" loop:YES afterDelay:4];
|
||||
[animationNode setAnimationForTrack:1 name:@"drawOrder" loop:YES];
|
||||
// [animationNode setAnimationForTrack:1 name:@"drawOrder" loop:YES];
|
||||
animationNode.timeScale = 0.3f;
|
||||
animationNode.debugBones = true;
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
if (!self) return nil;
|
||||
|
||||
SkeletonJson* json = SkeletonJson_create(atlas);
|
||||
json->scale = scale;
|
||||
json->scale = scale == 0 ? (1 / CC_CONTENT_SCALE_FACTOR()) : scale;
|
||||
SkeletonData* skeletonData = SkeletonJson_readSkeletonDataFile(json, [skeletonDataFile UTF8String]);
|
||||
NSAssert(skeletonData, ([NSString stringWithFormat:@"Error reading skeleton data file: %@\nError: %s", skeletonDataFile, json->error]));
|
||||
SkeletonJson_dispose(json);
|
||||
@ -110,7 +110,7 @@
|
||||
if (!_atlas) return 0;
|
||||
|
||||
SkeletonJson* json = SkeletonJson_create(_atlas);
|
||||
json->scale = scale;
|
||||
json->scale = scale == 0 ? (1 / CC_CONTENT_SCALE_FACTOR()) : scale;
|
||||
SkeletonData* skeletonData = SkeletonJson_readSkeletonDataFile(json, [skeletonDataFile UTF8String]);
|
||||
NSAssert(skeletonData, ([NSString stringWithFormat:@"Error reading skeleton data file: %@\nError: %s", skeletonDataFile, json->error]));
|
||||
SkeletonJson_dispose(json);
|
||||
|
||||
@ -27,7 +27,7 @@ bool ExampleLayer::init () {
|
||||
skeletonNode->addAnimation(0, "jump", false);
|
||||
skeletonNode->addAnimation(0, "walk", true);
|
||||
skeletonNode->addAnimation(0, "jump", true, 4);
|
||||
skeletonNode->addAnimation(1, "drawOrder", true);
|
||||
// skeletonNode->addAnimation(1, "drawOrder", true);
|
||||
|
||||
// skeletonNode->timeScale = 0.3f;
|
||||
skeletonNode->debugBones = true;
|
||||
|
||||
@ -92,7 +92,7 @@ CCSkeleton::CCSkeleton (const char* skeletonDataFile, spAtlas* atlas, float scal
|
||||
initialize();
|
||||
|
||||
spSkeletonJson* json = spSkeletonJson_create(atlas);
|
||||
json->scale = scale;
|
||||
json->scale = scale == 0 ? (1 / CCDirector::sharedDirector()->getContentScaleFactor()) : scale;
|
||||
spSkeletonData* skeletonData = spSkeletonJson_readSkeletonDataFile(json, skeletonDataFile);
|
||||
CCAssert(skeletonData, json->error ? json->error : "Error reading skeleton data.");
|
||||
spSkeletonJson_dispose(json);
|
||||
@ -107,7 +107,7 @@ CCSkeleton::CCSkeleton (const char* skeletonDataFile, const char* atlasFile, flo
|
||||
CCAssert(atlas, "Error reading atlas file.");
|
||||
|
||||
spSkeletonJson* json = spSkeletonJson_create(atlas);
|
||||
json->scale = scale;
|
||||
json->scale = scale == 0 ? (1 / CCDirector::sharedDirector()->getContentScaleFactor()) : scale;
|
||||
spSkeletonData* skeletonData = spSkeletonJson_readSkeletonDataFile(json, skeletonDataFile);
|
||||
CCAssert(skeletonData, json->error ? json->error : "Error reading skeleton data file.");
|
||||
spSkeletonJson_dispose(json);
|
||||
|
||||
@ -50,12 +50,12 @@ public:
|
||||
bool premultipliedAlpha;
|
||||
|
||||
static CCSkeleton* createWithData (spSkeletonData* skeletonData, bool ownsSkeletonData = false);
|
||||
static CCSkeleton* createWithFile (const char* skeletonDataFile, spAtlas* atlas, float scale = 1);
|
||||
static CCSkeleton* createWithFile (const char* skeletonDataFile, const char* atlasFile, float scale = 1);
|
||||
static CCSkeleton* createWithFile (const char* skeletonDataFile, spAtlas* atlas, float scale = 0);
|
||||
static CCSkeleton* createWithFile (const char* skeletonDataFile, const char* atlasFile, float scale = 0);
|
||||
|
||||
CCSkeleton (spSkeletonData* skeletonData, bool ownsSkeletonData = false);
|
||||
CCSkeleton (const char* skeletonDataFile, spAtlas* atlas, float scale = 1);
|
||||
CCSkeleton (const char* skeletonDataFile, const char* atlasFile, float scale = 1);
|
||||
CCSkeleton (const char* skeletonDataFile, spAtlas* atlas, float scale = 0);
|
||||
CCSkeleton (const char* skeletonDataFile, const char* atlasFile, float scale = 0);
|
||||
|
||||
virtual ~CCSkeleton ();
|
||||
|
||||
|
||||
@ -51,12 +51,12 @@ public:
|
||||
spAnimationState* state;
|
||||
|
||||
static CCSkeletonAnimation* createWithData (spSkeletonData* skeletonData);
|
||||
static CCSkeletonAnimation* createWithFile (const char* skeletonDataFile, spAtlas* atlas, float scale = 1);
|
||||
static CCSkeletonAnimation* createWithFile (const char* skeletonDataFile, const char* atlasFile, float scale = 1);
|
||||
static CCSkeletonAnimation* createWithFile (const char* skeletonDataFile, spAtlas* atlas, float scale = 0);
|
||||
static CCSkeletonAnimation* createWithFile (const char* skeletonDataFile, const char* atlasFile, float scale = 0);
|
||||
|
||||
CCSkeletonAnimation (spSkeletonData* skeletonData);
|
||||
CCSkeletonAnimation (const char* skeletonDataFile, spAtlas* atlas, float scale = 1);
|
||||
CCSkeletonAnimation (const char* skeletonDataFile, const char* atlasFile, float scale = 1);
|
||||
CCSkeletonAnimation (const char* skeletonDataFile, spAtlas* atlas, float scale = 0);
|
||||
CCSkeletonAnimation (const char* skeletonDataFile, const char* atlasFile, float scale = 0);
|
||||
|
||||
virtual ~CCSkeletonAnimation ();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user