setRotation3D(Vec3(30, 0, 0))".But now i don't know how to get button's(and..." /> setRotation3D(Vec3(30, 0, 0))".But now i don't know how to get button's(and..." /> setRotation3D(Vec3(30, 0, 0))".But now i don't know how to get button's(and..."/>

How to get Button position and size after "setRotation3D" in cocos2dx 3.3

271 views Asked by At

i have a button in the panel(cocos2dx 3.3), and call the methond "button->setRotation3D(Vec3(30, 0, 0))".But now i don't know how to get button's(and it's children) right position and contentSize on the screen after "transform".Anyone knows? Thanks.

1

There are 1 answers

0
himanshu kalal On

can you added your sptite in nodegird than like that

auto node=  NodeGrid::create();
        this->addChild(node);

        auto sp = Sprite::create("HelloWorld.png");
        sp->setPosition(100,330);
        node->addChild(sp);
        node->setRotation3D(Vec3(10,110,11));