mirror of https://github.com/axmolengine/axmol.git
Sprite3D set default _contentSize by AABB
This commit is contained in:
parent
117c38f806
commit
4099015421
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue