Armature::setAnchorPoint(const Vec2& point)设置锚点问题

Armature::setAnchorPoint(const Vec2& point)无论你传入什么值都会被自动转换为固定值
从(-1,-1)到(1,1)都试了都一样

额,哪个版本的?

3.2的:12::12::12::12:

我 log("%f %f",armature->getAnchorPoint().x,armature->getAnchorPoint().y);出来是正常的啊,改什么出什么

最新发现给精灵绑定刚体会改变描点,而且改变以后再次设置锚点就无效了

Sprite * spr = Sprite::create("image/m.png");
spr->setAnchorPoint(ccp(0.5,0));
log("%f,%f",spr->getAnchorPoint().x,spr->getAnchorPoint().y);
auto thebody = PhysicsBody::createBox(spr->getContentSize());
spr->setPhysicsBody(thebody);
log("%f,%f",spr->getAnchorPoint().x,spr->getAnchorPoint().y);

这是一个Bug,后面会对它进行修复的。

遇到急需要利用物理引擎碰撞又需要改变锚点的情况 暂时没有什么办法来解决吗?

添加刚体后重新设置下锚点不可以吗?

添加刚体后重新设置锚点无效
Sprite * spr = Sprite::create(“image/m.png”);
spr->setAnchorPoint(ccp(0.5,0));
log("%f,%f",spr->getAnchorPoint().x,spr->getAnchorPoint().y);
auto thebody = PhysicsBody::createBox(spr->getContentSize());
spr->setPhysicsBody(thebody);
log("%f,%f",spr->getAnchorPoint().x,spr->getAnchorPoint().y);
spr->setAnchorPoint(ccp(0.5,0));
log("%f,%f",spr->getAnchorPoint().x,spr->getAnchorPoint().y);

暂时没什么解决办法,我回帮楼主留意下,如果后续有什么办法会在这个帖子下跟帖回复。

:10: :10: :10: (⊙o⊙) 那谢谢斑竹大大了

还没有解决方案吗。。。同求呀:9::9::9::6::6: