//图片创建
CCSprite *sprite1=CCSprite::create("Icon.png");
sprite1->setPosition(ccp(100,100));
this->addChild(sprite1,0);
//裁剪左上角开始裁剪(图片+区域生成)
CCSprite *sprite2=CCSprite::create("Icon.png",CCRect(0, 0, 20, 50));
sprite2->setPosition(ccp(150,150));
this->addChild(sprite2,1);
//通过祯缓存中的一祯名字生成
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("test_icon.plist");
CCSprite *sprite3=CCSprite::createWithSpriteFrameName("Icon.png");
sprite3->setPosition(ccp(200,200));
this->addChild(sprite3,2);
//通过另外一祯生成一个生成
CCSpriteFrame*frame=CCSpriteFrame::create("Icon.png",CCRect(20, 20, 30, 30));
CCSprite* sprite4=CCSprite::createWithSpriteFrame(frame);
sprite4->setPosition(ccp(200,350));
this->addChild(sprite4);
本文深入探讨了游戏开发领域的关键技术,包括cocos2dX、unity3d、Unreal Engine等游戏引擎的应用,以及OpenGL、OpenCV等图像处理技术在AR特效制作中的实践案例。
1086

被折叠的 条评论
为什么被折叠?



