Well I see now why you changed the scrolling manager, if the window is
set to scaled the 0.3 scrolling manager will adjust for the size of
the window but the scale will be messed up because of keeping the
aspect ratio the window size is not neccesarily the same ratio to the
scale it was when the window was created, which messes up the focus. I
made a quick hack for pyweek in my game for the 0.3 scrolling manager
to check if the director is using the scaled or non scaled for
window.on_resize, but since the director doesn't really keep a
variable telling you which it is using I had to compare functions for
equality...not a great idea:
in set_focus:
if cocos.director.director.window.on_resize is
cocos.director.director.unscaled_resize_window:
w = int(self.viewport.width / self.scale)
h = int(self.viewport.height / self.scale)
else:
w, h = cocos.director.director.get_window_size()
so, something to think about. It would be good if the scrolling
manager worked correctly for scaled and unscaled resizes, but I don't
know what the best solution would be. Both 0.3 and SVN scrolling
manager have issues with resizing the window.
On Aug 29, 6:10 pm, Devon Scott-Tunkin <[email protected]>
wrote:
> Okay, I narrowed the scaling bug down in svn tiles to the
> ScrollingManager.
>
> specifically this line was removed from both set_view and force_view:
> self.view_w, self.view_h = w, h
>
> interestingly though if I re add those lines, that only corrects
> zooming out, but zooming in is still screwed up, possibly for a
> different reason...
> I can't for the life of me see why this is since the logic is
> basically the same, but regressing the whole ScrollingManager back to
> version 0.3 of the scrolling manager fixes all scaling issues.
>
> Also I highly suggest going back to the 0.3 scrolling manager with
> self.viewport because even if the scaling does get fixed, resizing the
> director.window when do_not_scale=True will still break
> RectMapLayer.get_at_pixel (and does when I drag the window bigger in
> cocograph) because the viewport changes but the ScrollingManager has
> no way to know this has happened since view_w, and view_h are only in
> reference to the original window size. 0.3 ScrollingManager works fine
> (once I refresh the window by doing something in cocograph of course)
>
> I hope that made sense :)
>
> Devon
>
> On Aug 27, 10:51 pm, Richard Jones <[email protected]> wrote:
>
>
>
>
>
> > On 28/08/2009, at 12:36 PM, Devon Scott-Tunkin wrote:
>
> > > Thanks a lot guys! With a few tweaks property and requires work
> > > correctly now.
>
> > > Two things I notice now:
>
> > > 1) the _as_xml Cell properties still need the fix that RectMapLayer
> > > got, I attached a patch in the files (basically just copy paste the
> > > part from RectMapLayer _as_xml.
>
> > Whups! Fixed, along with another missed filename mangle :)
>
> > > 2) With svn cocos, zooming in and out (scaling the map layer) seems to
> > > have broken the highlight placement, which probably means the
> > > transformation isn't registering for this:
> > > cell = m.get_at_pixel(*self.parent.pixel_from_screen(x, y))
> > > I think this is the problem I noticed before with the trunk tools/
> > > editor.py and svn cocos.
>
> > Hmm. That requires more debugging. Feel free! :)
>
> > Richard
>
> On Aug 27, 10:51 pm, Richard Jones <[email protected]> wrote:
>
>
>
> > On 28/08/2009, at 12:36 PM, Devon Scott-Tunkin wrote:
>
> > > Thanks a lot guys! With a few tweaks property and requires work
> > > correctly now.
>
> > > Two things I notice now:
>
> > > 1) the _as_xml Cell properties still need the fix that RectMapLayer
> > > got, I attached a patch in the files (basically just copy paste the
> > > part from RectMapLayer _as_xml.
>
> > Whups! Fixed, along with another missed filename mangle :)
>
> > > 2) With svn cocos, zooming in and out (scaling the map layer) seems to
> > > have broken the highlight placement, which probably means the
> > > transformation isn't registering for this:
> > > cell = m.get_at_pixel(*self.parent.pixel_from_screen(x, y))
> > > I think this is the problem I noticed before with the trunk tools/
> > > editor.py and svn cocos.
>
> > Hmm. That requires more debugging. Feel free! :)
>
> > Richard- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---