Open adf5051 opened 7 years ago
pygame.display.get_surface() returns None when running PyCut as an activity. It works fine when directly invoked with python, but the packaged version apparently cannot access the screen context.
This might be something @wilfriedE could advise a little better on. We had the same issue when building the game originally, but I'm still a little unclear on what our fix was.
I was able to get the original repo's version to run with python by installing the enum34 module. But I still get the black screen when I build the xo file.
Stack trace for black screen error
Traceback (most recent call last) : File "/home/olpc/Activities/PyCut.activity/sugargame/init.py", line 58, in _run_pygame_cb main.fn() File "/home/olpc/Activities/PyCut.activity/game/init.py", line 95, in run self.game.loop() File "/home/olpc/Activities/PyCut.activity/game/init.py", line 87, in game_loop self.active_scene.Render() File "/home/olpc/Activities/PyCut.activity/game/scenes/title_scene.py", line 36, in Render self.screen.fill((255, 255, 255)) AttributeError: 'NoneType' object has no attribute 'fill'
So self.screen is None, and self.screen is set with pygame.display.get_surface()
I'm getting assertion errors about pygame being init'ed before run_pygame. moving some stuff around I get other assertion errors because run_pygame getting called too many times...but that seems more to be that the surface is being set too many times. Look more into this later...
@adf5051 Can you post the full log for the error?
I posted the trace earlier in this thread, the screen drawing surface is None
@tcreeds, @adf5051 The Black Screen Issue is resolved in https://github.com/tcreeds/PyCut/pull/14
Original Issue
To close issue #1 we removed enum. This allows us to run the raw python file but the final XO program presents us with a black screen. The original issue states that using enum34 fixes this issue. Maybe we should try this as well.