bool
MyScene::init()
{
Size size = Director::getInstance()->getWinSize();
Sprite *sp1 = Sprite::create(
"icon.png"
);
sp1->setPosition(Vec2(size.width*0.2,size.height*0.7));
this
->addChild(sp1);
Sprite *sp2 = Sprite::create(
"icon.png"
,Rect(10,30,28,28)) ;
sp2->setPosition(Vec2(size.width*0.4,size.height*0.7));
this
->addChild(sp2);
Texture2D *texture = TextureCache::sharedTextureCache()->addImage(
"icon.png"
);
Sprite *sp3 = Sprite::createWithTexture(texture);
sp3->setPosition(Vec2(size.width*0.6,size.height*0.7));
this
->addChild(sp3);
Sprite *sp4 = Sprite ::createWithTexture(texture,Rect(0,0,40,40));
sp4->setPosition(Vec2(size.width*0.8,size.height*0.7));
this
->addChild(sp4);
SpriteFrame *frame = SpriteFrame::create(
"icon.png"
,Rect(0,0,57,57));
Sprite *sp5 = Sprite::createWithSpriteFrame(frame);
sp5->setPosition(Vec2(size.width*0.3,size.height*0.3));
this
->addChild(sp5);
SpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile(
"img.list"
);
Sprite *sp6 = Sprite::createWithSpriteFrame(
"icon.png"
);
sp5->setPosition(Vec2(size.width*0.3,size.height*0.3));
this
->addChild(sp6);
return
true
;
}
;