骨骼动画贴图错位问题

cocostudio导出骨骼图,区分是否retina屏,为何在设置了缩放比( setContentScaleFactor(2))后,骨骼会出现图与图之间有很大缝隙,cocos2dx也是这样用的,我将骨骼在示列代码中运行显示,结果也是如此,我想不通的是,为何示列中可以显示正常,求大神指教!

使用高分辨率的屏幕必须在HD目录下放置相同的资源。
解决方法参考:http://www.cocoachina.com/bbs/read.php?tid=161698

我已经将骨骼文件放到hd文件夹了,但只要设置了setContentScaleFactor(2)就出问题了:9::9:

这样的还请楼主将做过哪些修改说明一下,最好提供一个实例程序,能让我们这个问题的重现。

我是在示列代码里面将原有的骨骼图换成我自己生成的,同样是在hd文件夹下,其他地方没有修改

CCSize designSize = CCSizeMake(480, 320);

CCFileUtils* pFileUtils = CCFileUtils::sharedFileUtils();
std::vector<std::string> searchPaths;

if (screenSize.height > 320)
{
    CCSize resourceSize = CCSizeMake(960, 640);
    searchPaths.push_back("hd");
    searchPaths.push_back("hd/scenetest/ArmatureComponentTest");
    searchPaths.push_back("hd/scenetest/AttributeComponentTest");
    searchPaths.push_back("hd/scenetest/BackgroundComponentTest");
    searchPaths.push_back("hd/scenetest/EffectComponentTest");
    searchPaths.push_back("hd/scenetest/LoadSceneEdtiorFileTest");
    searchPaths.push_back("hd/scenetest/ParticleComponentTest");
    searchPaths.push_back("hd/scenetest/SpriteComponentTest");
    searchPaths.push_back("hd/scenetest/TmxMapComponentTest");
    searchPaths.push_back("hd/scenetest/UIComponentTest");
    searchPaths.push_back("hd/scenetest/TriggerTest");
    pDirector->setContentScaleFactor(resourceSize.height/designSize.height);
}
else
{
    
    searchPaths.push_back("scenetest/ArmatureComponentTest");
    searchPaths.push_back("scenetest/AttributeComponentTest");
    searchPaths.push_back("scenetest/BackgroundComponentTest");
    searchPaths.push_back("scenetest/EffectComponentTest");
    searchPaths.push_back("scenetest/LoadSceneEdtiorFileTest");
    searchPaths.push_back("scenetest/ParticleComponentTest");
    searchPaths.push_back("scenetest/SpriteComponentTest");
    searchPaths.push_back("scenetest/TmxMapComponentTest");
    searchPaths.push_back("scenetest/UIComponentTest");
    searchPaths.push_back("scenetest/TriggerTest");
}
pFileUtils->setSearchPaths(searchPaths);

这是示列里面Appdelegate的源码

CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfoAsync("ll-xh-zh/ll-xh-zh.ExportJson", this, schedule_selector(TestAsynchronousLoading::dataLoaded));

这是加载代码

void TestCSWithSkeleton::onEnter()
{
ArmatureTestLayer::onEnter();
cocos2d::extension::CCArmature *armature = NULL;
armature = cocos2d::extension::CCArmature::create(“ll-xh-zh”);
armature->getAnimation()->playWithIndex(0);
armature->setScale(0.2f);

armature->setPosition(ccp(VisibleRect::center().x, VisibleRect::center().y/*-100*/));
addChild(armature);

}

这是使用代码

resources文件夹下是否放置资源?

放了放了,就是放在resources下面的

不然就会报错,放了的

你说,有没有可能是骨骼图本身的问题

您好,动画本身是没有问题的,可能因为分辨率的问题,需要注意一些资源管理的问题。

如果添加允许,请您在Q上联系我一下,我帮你检查一下资源在哪出了问题。

我的qq是513661826

你qq多少?告诉我,我加你

此问题困扰我多时,经过Hanrea的悉心指导,算是避免了这个问题,那就是对于缩放比的使用,缩放比不是这么使用的。我原来使用缩放比的本意是为了在一个设计分辨率下,适应不同分辨率的设备,但这样行不通,骨骼图会出错,Hanrea说我做的项目不适合使用缩放比,s缩放比的使用是在只用一套资源而要适配多种设备的情况下,Hanrea后面告诉我关于适配的方法,通过判断设备分辨率来区分不同的设备,使用相应分辨率的图片,在图片上解决适配的问题,相应的,不同分辨率设备设置不同的设计分辨率,不使用缩放比,设计分辨率跟缩放比不能混用,现在我是这么弄的,放弃使用缩放比,不知道各位还什么高招,或者如果发现我说的有错误的话,请多多指正,谢谢

你确定你的骨骼本身没有问题么
父子关系
出现间隙,是因为他们本身在放大2倍的时候,是各自放大,而不是基于一个点,一起放大