On Tue, Jun 25, 2013 at 10:11 AM, Paul Pittlerson <[email protected]>wrote:

> When starting the window with some size, for example width, height = 500,
> 500
>   width, height = 500, 500
>   director.init(width,height,vsync=False,do_not_scale=True)
>

> And then resizing the window when changing scene:
>
>   class StartEditor(Layer):
>     def __init__(self):
>         super(StartEditor, self).__init__()
>
>         director.window.set_size(1200, 900)
>
>   director.replace(Scene(StartEditor()))
>
> The window changes size as expected, but all Layers seems to think it's
> still the original width and height of the first scene, for example:
>
>
>   print director.get_window_size()
>
> Gives the original values:
>   (500, 500)
>
>
from the docstring for Director.get_window_size:
"""Returns the size of the window when it was created, and not the
actual size of the window.
...
"""
This is useful when you let cocos autoscale on resize.


To access the real viewport geometry you can use
      director._usable_width
      director._usable_height

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to