Hey, I am still struggling to get this working.

Why are restricted_fx,fy not initialized in scrolling_manager's
constructor?

As far as I can tell the editor does not call set_focus in __init__ or
on_enter, or anywhere else other than after restricted_fx is
referenced. I cannot figure out why it works.

I have tried calling set_focus right after initializing the scrolling
manager. It still doesn't create a restricted_fx. I have also tried
doing a force_focus and a set_focus w/ force=True.

If I set scroller.restricted_fx = 100, and then call set_focus(0,0),
then print restricted_fx: it will be 100. So it seems set_focus is not
affecting that variable. But I can get into the module code and I see
where it the set_focus is setting the variable.

scroller = cocos.layer.ScrollingManager()

Would you like to see my code, or is there some test you think I
should run?

Thanks,
Andy

On Oct 4, 12:36 am, claudio canepa <[email protected]> wrote:
> On Tue, Oct 4, 2011 at 1:30 AM, Andy <[email protected]> wrote:
> > Hey, thanks for your time.
>
> > I upgraded to .5rc0 and verified:
> > >>> import cocos
> > >>> print cocos.__version__
> > 0.5rc0
>
> > but I am still running into this problem. It creates the screen just
> > fine but the moment that it updates mouse position, Bam:
> >  File "viewr.py", line 231, in update_view_bounds
> >    scx , scy =
> > world_to_screen(scroller.restricted_fx,scroller.restricted_fy)
> > AttributeError: 'ScrollingManager' object has no attribute
> > 'restricted_fx'
>
> > I delved into the library and I do indeed see a self.restricted_fx in
> > ScrollingManager, but it is only referenced inside of set_focus, and
> > it does not call set_focus after until after it looks up
> > restricted_fx. Am I missing an init step?
>
> > Thanks,
> > Andy
>
> The editor initializes some variables at __init__ and at on_enter.
> Probably calls set_focus.
> Or you can call set_focus right after instantiating a ScrollerManager.
>
> --
> 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