On Sun, Oct 2, 2011 at 5:36 PM, Andy <[email protected]> wrote:

> I want to zoom around my cursor location. I can get the mouse
> information and convert it into layer coordinates, so that is not a
> problem.
>
> Given a world coordinate, how do I scale around that point? My
> understanding is that scaling happens around the transform_anchor, and
> zooming will happen around the transform_anchor of my scrolling
> manager. But when ever I move the transform_anchor, I think it takes
> all my sprites with it.
>
> How do I go about scaling around a given point?
>
> Thanks,
> Andy
>
>


We have an editor  that zooms around the mouse pointer, I think the zoom
code there can be near to what you want.

You can see the editor code at
http://code.google.com/p/los-cocos/source/browse/branches/protoeditor/tools/protoeditor/e2_protoeditor.py

Look at lines 413 - 440 , they handle the zoom.

Protoeditor is work in progress, not ready to use as editor, but if if you
want to see  how the zoom looks you must checkout the branch and launch from
samples/runner/start_editor.py

I'm very short on time so I will not expand about the code, feel free to ask
for clarification.

--
claudio

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cocos-discuss?hl=en.

Reply via email to