Sprite3D set default _contentSize by AABB

This commit is contained in:
songchengjiang 2014-09-09 17:47:34 +08:00
parent 117c38f806
commit 4099015421
2 changed files with 1 additions and 1 deletions

View File

@ -53,6 +53,7 @@ Sprite3D* Sprite3D::create(const std::string &modelPath)
auto sprite = new (std::nothrow) Sprite3D();
if (sprite && sprite->initWithFile(modelPath))
{
sprite->_contentSize = sprite->getBoundingBox().size;
sprite->autorelease();
return sprite;
}

View File

@ -251,7 +251,6 @@ Sprite3DHitTest::Sprite3DHitTest()
sprite2->setScale(4.f);
sprite2->setTexture("Sprite3DTest/boss.png");
sprite2->setPosition( Vec2(s.width/2, s.height/2) );
sprite2->setContentSize(Size(20, 20));
sprite2->setAnchorPoint(Vec2(0.5, 0.5));
//add to scene