Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>OK, so, as I mentioned above for something like this, one possible answer is to use the CCLens3D class to get the "effect" of magnifying something in a circular manner.</p> <p>I found using this to be a little tricky because it doesn't seem to work unless it's a child of the top level node of your 'scene'.</p> <p>Here is some code I use to create a lens that moves around the screen, and then disappears:</p> <pre><code> // Create the lens object first. // CCLens3D *lens = [CCLens3D actionWithPosition:fromPos radius:50 grid:ccg(50, 50) duration:2.0]; // Set the "size" of the lens effect to suit your needs. // [lens setLensEffect:1.0]; // In my case, I then move the lens to a new position. To apply an action on // a lens, you need to give the actions to the actionManager in the // CCDirector instance. // CCMoveTo *move = [CCMoveTo actionWithDuration:2.0 position:toPos]; // I had another action in this array, but this will do. // CCSequence *seq = [CCSequence actions:move, nil]; // Now tell the actionManager to move the lens. This is odd, but it works. // [[[CCDirector sharedDirector] actionManager] addAction:seq target:lens paused:NO]; // Now just for some more weirdness, to actually make the lens appear and operate // you run it as an action on the node it would normally be a child of. In my case // 'self' is the CCLayer object that is the root of the current scene. // // Note that the first action is the lens itself, and the second is a special // one that stops the lens (which is a "grid" object). // [self runAction:[CCSequence actions:lens, [CCStopGrid action], nil]]; </code></pre> <p>I imagine that you should be able to stop the grid by running the CCStopGrid action when you want to. In my case it is a programmed thing. In yours it might be when the user lets go of a button.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload