2

我正在尝试将背景精灵(使用较大尺寸的图像资源)缩放到较小的尺寸,但无法做到这一点。

我这样做如下:

CCSprite *splashSprite =CCSprite::spriteWithFile("splashscreen.jpg");
 splashSprite->setPosition(ccp(240, 150));
 splashSprite->setScale(0.5f);

但精灵保持其原始大小。不用找了。请帮忙。

4

1 回答 1

2

你可以这样做。有用

CCSprite* splashSprite= CCSprite::create("splashscreen.png");
splashSprite->setPosition(ccp(240, 150));
splashSprite->setScale(0.5f);
this->addChild(splashSprite, 0);
于 2013-08-21T13:16:59.133 回答