代码如下
std::string name] = {“Walk”, “FireMax”, “Fire”};
std::vectorstd::string names(name, name+3);
Armature *armature = NULL;
armature = Armature::create(“Cowboy”);
armature->getAnimation()->playWithNames(names);
armature->setScale(0.2f);
auto box = armature->getBone(“Layer120”)->getBoundingBox();
log(“x = %f, y = %f, w = %f, h = %f”, box.origin.x, box.origin.y, box.size.width, box.size.height);
为什么x,y,w,h的输出结果均为0?难道是我使用方法有问题?
你好,您的获取方法应该有问题,对于bone来说应该没大小的,bone上的renderNode才会有大小。
:856::856::856:谢谢版主,已经可以了。