Hi all !
Have a nice day , guys !
Currently , I have the ParticleBatchNode and I want to set texture for it !
auto batchNode = ParticleBatchNode::createWithTexture(nullptr, 200);
batchNode->setName(“batchNode”);
addChild(batchNode);auto spriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(“money_icon.png”);
auto texture = spriteFrame->getTexture();
batchNode->setTexture(texture);
As you see , I trimmed small texture (“money_icon.png”) from large texture of SpriteSheet. I think the above code work fine !
But …OMG !.. the spriteFrame->getTexture() function gives me the whole texture of my sprite sheet, I want only 1 sprite’s texture from “money_icon” name. How can i do that ?
Thanks All !