You must call director.init before using most of cocos functionality
(because some parts want to know the windows size, and thaat is only
defined after director.init)

Probably the documentation should state this.



On Wed, Dec 31, 2014 at 1:40 PM, leonardo esparis <[email protected]>
wrote:

> #!/usr/bin/env python
> from __future__ import absolute_import
>
> from cocos.director import director
> from cocos.scene import Scene
> from Capas.MundoUno import MundoUno
> from Menus.menu import MainMenu
>
>
> def main():
>         print director.get_window_size()
>         director.init(width=800, height=600, caption="Hello World")
>         director.run(Scene(MainMenu()))
>
> if __name__ == '__main__':
>         main()
>
>
> this is the terminal's output
>  File "main.py", line 16, in <module>
>     main()
>   File "main.py", line 11, in main
>     print director.get_window_size()
>   File "/usr/local/lib/python2.7/dist-packages/cocos/director.py", line
> 525, in get_window_size
>     return ( self._window_virtual_width, self._window_virtual_height)
> AttributeError: 'Director' object has no attribute '_window_virtual_width'
>
>
>
>
>
>
>
>
>  --
> 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/d/optout.
>

-- 
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/d/optout.

Reply via email to