-1

This has already been asked at Add a magnifier in cocos2d games But I didn't quite understand the answer. I am using the same tutorial Let's Spot It is using but I'm not sure where to put madhu's code. I also don't know what the runAction method looks like.

Thanks

Community
  • 1
  • 1
Clinton Walsh
  • 167
  • 3
  • 14
  • possible duplicate of [Add a magnifier in cocos2d games](http://stackoverflow.com/questions/6174882/add-a-magnifier-in-cocos2d-games) – PengOne Jul 01 '11 at 22:06

1 Answers1

0

Hmm... Cocos2d CCLens3D, makes the area that is set by the programmer to popup.. Please look at the example provided by cocos2d..

the codes:

id lens = [CCLens3D actionWithPosition:ccp(size.width/2,size.height/2) radius:240 grid:ccg(15,10) duration:0.0f]; 



[self runAction:lens];

self is the layer where your image should be..

ccp(size.width/2, size.height/2) should be changed to ccp(yourPosition.x, yourPosition.y), means the positions which you want the popUp to be at.. Radius is the size of the circle, duration is how long you want it to be, 0.0 meaning infinite.. grid just use the same values..

xuanweng
  • 1,939
  • 1
  • 11
  • 10
  • Yes but where should it all be put, if I have a scene where I need to magnify something. I can't figure out how to call the magnify class, or use the code madhu provided – Clinton Walsh Jul 04 '11 at 16:23
  • could you detect the area which the player presses? put it at the layer where the image is being added... – xuanweng Jul 05 '11 at 04:41
  • I am just using it to zoom in on the touch area of the user. But I still dont know what is in the runAction method – Clinton Walsh Jul 08 '11 at 23:18
  • hmm... so the area that you are going to zoom is a CCSprite, right? call the sprite to run the action... – xuanweng Jul 09 '11 at 17:19