You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey ,
i am trying to animate sprites from my spritesheet and accesss using Sprite Frame cache.The App crashes abruptly stating "Access Violation" in output log. i am using Cocos2d-x V3.3. I am posting the following code that i used .
//Accessing the plist file from asserts->Resources
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("myPlist.plist");
//Loading Single Image into Canvas from the Plist.
image= CCSprite::createWithSpriteFrameName("frame-1.png");
image->setPosition(Point(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y));
image->setScale(rX);
this->addChild(image,1);
//For Animating the Sprite
CCArray *frames = CCArray::create();
Vector<SpriteFrame*> animFrames(3);
char str[50] = {0};
for(int i = 1; i <= 3; i++)
{
sprintf(str, "frame-%d.png",i);
auto frame = SpriteFrame::create(str,Rect(0,0,62,62));
animFrames.pushBack(frame);
/*CCString *frame = CCString::createWithFormat("frame-%d.png", i);//frame-1
frames->addObject(CCSpriteFrameCache::sharedSpriteFrameCache()- >spriteFrameByName(frame->getCString()));*/
}
auto animation = Animation::createWithSpriteFrames(animFrames, 0.2f);
auto animate = Animate::create(animation);
image->runAction(animate);
This code Works Perfectly on Android and IOS .IS there a problem with windows phone. i am testing on Windows Phone Emulator 512mb RAM.
Please Help me with this.
The text was updated successfully, but these errors were encountered:
Hey ,
i am trying to animate sprites from my spritesheet and accesss using Sprite Frame cache.The App crashes abruptly stating "Access Violation" in output log. i am using Cocos2d-x V3.3. I am posting the following code that i used .
//Accessing the plist file from asserts->Resources
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("myPlist.plist");
//Loading Single Image into Canvas from the Plist.
image= CCSprite::createWithSpriteFrameName("frame-1.png");
image->setPosition(Point(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y));
image->setScale(rX);
this->addChild(image,1);
//For Animating the Sprite
CCArray *frames = CCArray::create();
This code Works Perfectly on Android and IOS .IS there a problem with windows phone. i am testing on Windows Phone Emulator 512mb RAM.
Please Help me with this.
The text was updated successfully, but these errors were encountered: