2013-08-24 11:52:48
1
2
3
4
5
6
7
8
9
| ; CCSize size=CCDirector::sharedDirector()->getWinSize(); CCSprite* CCSprite::create(". /Images/menu/ingamepig.png");//,CCRectMake(0,0,800,480)); CC_BREAK_IF(!backGround); float scalX=size.width/backGround->getContentSize().width;///設置x軸方向的縮放係數 float scalY=size.height/backGround->getContentSize().height;//設置y軸方向的縮放係數 backGround->setScaleX(scalX); backGround->setScaleY(scalY); backGround->setPosition(ccp(size.width/2,size.height/2)); this->addChild(backGround,0,0); |
沒有留言:
張貼留言