Home Game Development Read plist information and built-in png photos in cocos2d-x – C++

Read plist information and built-in png photos in cocos2d-x – C++

0
Read plist information and built-in png photos in cocos2d-x – C++

[ad_1]

the code as follows:

	SpriteFrameCache *sfc = SpriteFrameCache::sharedSpriteFrameCache();
	sfc->addSpriteFramesWithFile("protagonist_move/aaaa.plist");
	auto sprites = SpriteBatchNode::create("protagonist_move/aaaa.png");
	sprites->setPosition(Point::ZERO);
	this->addChild(sprites, 1);
	auto s = Sprite::createWithSpriteFrameName("10020.png");
	s->setPosition(Point(CCRANDOM_0_1() * 480, CCRANDOM_0_1() * 320));
	this->addChild(s,3);
	auto s1 = Sprite::createWithSpriteFrameName("10021.png");
	s1->setPosition(Point(CCRANDOM_0_1() * 180, CCRANDOM_0_1() * 320));
	this->addChild(s1,2);

But it reveals the error:
1>d:cocos2d-x-3.17testsgame2classeshelloworldscene.cpp(125): warning C4996: ‘cocos2d::SpriteFrameCache::sharedSpriteFrameCache’: Declared as veto
1>d:cocos2d-x-3.17testsgame2cocos2dcocos2dccspriteframecache.h(101): notice: see “cocos2d::SpriteFrameCache::sharedSpriteFrameCache”assertion of

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here