[c++] simple magnifier

Hi!
There is a simple rectangle magnifier class. Feel free to modify and share more complicated versions.

Usage sample:

CMagnifier* mag = CMagnifier::create();
 CCSize someSize = ...
 mag->setSize(someSize);

 float scaleFactor = ...;
 mag->setScaleFactor(scaleFactor);

 mag->initWithCurrentScreen();

 CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(mag, INT_MAX, true);

 this->addChild(mag);

 CCPoint position = ...;
 mag->setPosition(position);


Magnifier.zip (3.4 KB)

thank for share :slight_smile:
do you have any code of dialog for cocos2d-x? it’s so popular for game. if you have any code, please share for me

What are you mean in “dialog”? Modal message box? If so, please refer to http://cocos2d-x.org/forums/6/topics/6518?r=18692#message-18692

yes. but it’s not compatible with cocos2d 2.x :frowning: