Skip to content

syuhari/CCMask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CCMask

CCMask is a class which makes masking in Cocos2D-x v2.0 fairly easy.
You just have to define an object and a mask. And that's it!

Usage:

// Create a mask and an object
CCSprite* mask = CCSprite::create("mask_circle.png");
CCSprite* object = CCSprite::create("HelloWorld.png");
object->setPosition(ccp(mask->getContentSize().width/2, mask->getContentSize().height/2));

// Create a masked image
CCMask* masked = CCMask::create(mask , object);
masked->setPosition(ccp(size.width/2, size.height/2));
this->addChild(masked);

alt text

About

mask a CCSprite with cocos2d-x v2.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published