On Wed, Apr 11, 2012 at 4:40 PM, Nitneroc <[email protected]> wrote:
> This sounds a bit stupid, but I couldn't find a way to change the fps > limit. I read somewhere how to do it for pyglet, but it did'nt seem to > work in cocos2d. > > Is there any way to do so ? > > -- > This was feasible with pyglet 1.1.4, but seems to not work with pyglet 1.2dev. Tested by modifying the test_sprite.py in cocos by """ director.init() pyglet.clock.set_fps_limit(30) director.show_FPS = True """ You can toogle the display of fps in cocos by pressing ctrl-x In windows, pyglet 1.1.4 somehow tries to comply; with 1.2 dev it goes full tilt. In theory, you can have the following fps locking status in pyglet, with or without cocos: no locking: (passing vsync=False when creating the Window in pyglet or passing vsync=False when calling director.init() in cocos) You get the maximun frame rate your system can deliver locking to vertical retrace: with vsync=True , which is the default, you get the same framerate as your monitor refresh rate locking to a specific value: import pyglet.clock pyglet.clock.set_fps_limit(limit) Note: you need to have at least one scheduled function, even if it does anything, or the framerate drops to aprox 14 fps -- 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.
