On Sun, Aug 2, 2009 at 4:26 AM, jaber <[email protected]> wrote:

>
>
>
> On Aug 1, 4:26 am, claudio canepa <[email protected]> wrote:
> > On Fri, Jul 31, 2009 at 9:22 AM, jaber <[email protected]> wrote:
> >
> > > Help
> >
> >  post some code
> The game scrolling system is by moving and scaling the game layer (not
> opengl camera as it messes with other cocos2d stuff like Menu, etc):
>
> class Game(Layer):
>  is_event_handler = True
>  def __init__(self):
>    Layer.__init__(self)
>    self.hero = Hero()
>  def update(self,dt):
>    # move the layer based on the hero's position
>
>  def on_mouse_scroll(x,y,dx,dy):
>    self.scale += dy*0.25
>
>  def on_mouse_press(x,y,button,modifiers):
>    print x-self.x, y-self.y


Ehh, too little code to work over it, so I modified a hud example.
It assumes no rotation are applied to the game layer.
Attached hud+chasecam+zoom+pick2.py
By the way, I lifted the coords changes from tiless-editor ( in cocos svn
branches\cocos2d-editor )
--
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
-~----------~----~----~----~------~----~------~--~---

Attachment: hud+chasecam+zoom+pick2.py
Description: Binary data

Reply via email to