[pygame] pygame to android -- problem with font objects
Greetings! The code works fine on my PC (runs Linux of course), i.e., it prints hello world on the window it produces. But when I make it into an apk with the pgsa-0.9.4 kit and run it on my phone, it puts garbage on the screen. ;o( I've put pygame apps on the phone which don't use the Font objects and they run fine. ;o) 'freesans' is a shot in the dark. i'm wondering if that's the culprit. Thanks in advance for any ideas, Tom Arnall Baja Norte - Happiness is a barometer, not the purpose. == import pygame, sys, os, random from pygame.locals import * import time try: import android except ImportError: android = None def stop(interval=3): print stopping + str(interval) time.sleep(interval) pygame.init() BLACK = (0, 0, 0) WHITE = (255, 255, 255) width = 400 height = 400 screen = pygame.display.set_mode((width, height)) background = pygame.Surface(screen.get_size()) background = background.convert() background.fill(WHITE) surface = pygame.Surface((width,height)) font = pygame.font.SysFont(freesans, 25) itemSurface = font.render(hello world!, True, BLACK, WHITE) surface.blit(itemSurface, (0,0)) background.blit(surface, (0,0)) screen.blit(background,(0,0)) pygame.display.flip() stop(20)
Re: [pygame] pygame to android
On Wed, 2015-07-22 at 22:57 +, Tom Rothamel wrote: That being said, all the Ren'Py packager does is to copy various files into zip or tar.bz2 files with appropriate permissions info, so if someone wants to make a standalone tool or distribution, they can. What's the advantage of this over a generic tool that can create frozen binaries, such as pyinstaller? signature.asc Description: This is a digitally signed message part
Re: [pygame] pygame to android
got it. so pygame gives you test-harness tools? On 7/22/15, Tom Rothamel t...@rothamel.us wrote: The theory is that pygame_sdl2 will be able to run the pygame test suite at some point. On Wed, Jul 22, 2015 at 9:30 PM tom arnall kloro2...@gmail.com wrote: And pygame_sdl2 is far from ready - there's no test suite, for example. what happened to write tests first! ? On 7/22/15, Tom Rothamel t...@rothamel.us wrote: On Wed, Jul 22, 2015 at 4:37 PM Luke Paireepinart rabidpoob...@gmail.com wrote: Tom, Is sdl2 Pygame the way forward for Pygame? I think it is - but I'm biased about this. And pygame_sdl2 is far from ready - there's no test suite, for example. All I can say is that I need/plan to maintain pygame_sdl2 indefinitely to support Ren'Py. (Or at least until a better implementation of the Pygame API comes about.) I would be interested in assisting with a generic Pygame packager for cross platform applications. Where would we get started in doing that, to separate it from Ren'Py in a generic way? I'd suggest grabbing a copy of the Ren'Py SDK (from www.renpy.org), creating a new project, and building distributions of it, just to get a feel for what the tools can do in terms of installing text editors and packaging games for various platforms. My thinking is the right thing to would be to modify the Ren'Py launcher so that it can be rebranded and released as a pygame tool, as opposed to trying to make something standalone. This is for pragmatic reasons - maintaining a split version would be more ongoing work that coming up with a variant of the launcher that can launch and package arbitrary pygame apps. That being said, all the Ren'Py packager does is to copy various files into zip or tar.bz2 files with appropriate permissions info, so if someone wants to make a standalone tool or distribution, they can. -- .. Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency. -- .. Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency.
RE: [pygame] pygame to android
Tom, Is sdl2 Pygame the way forward for Pygame? I would be interested in assisting with a generic Pygame packager for cross platform applications. Where would we get started in doing that, to separate it from Ren'Py in a generic way? -Original Message- From: Tom Rothamel t...@rothamel.us Sent: 7/22/2015 9:59 AM To: pygame-users@seul.org pygame-users@seul.org Subject: Re: [pygame] pygame to android On Wed, Jul 22, 2015 at 4:11 AM tom arnall kloro2...@gmail.com wrote: what is the relationship between RenPy and Pygame? Ren'Py is a game engine that people use to make specific types of generally narrative-heavy games. Visual Novels, Life Simulations, and simple RPGs are all within what Ren'Py was intended to help make. For ten years, Ren'Py was based on Pygame, to the point where the Pygame API is included in various places in the Ren'Py API. About a year ago, it became clear that SDL2 would be necessary for Ren'Py to keep supporting Android and add iOS support, so we wrote Pygame_sdl2, a reimplementation of the Pygame API over SDL2. (Pygame_sdl2 isn't complete, as it needs help from people who understand buffers and the pygame test suite.) Ren'Py has a number of tools that are used to package games for mobile platforms - RAPT is used for Android, while Renios is used for iOS. These tools are generally written in a way that they can be used to package arbitrary games written using pygame_sdl2. Ren'Py itself also comes with a launcher that can one-click package a Ren'Py game for Windows, Mac OS X, and Linux - with a few more clicks, it also takes care of Android and iOS packaging. This isn't designed to work with arbitrary pygame code, but could plausibly be changed to do so. Due to terrible social skills, I haven't really contributed much of this Ren'Py work back to pygame - and the one project I did contribute, pygs4a, turned out to be a technological dead end. I'm trying to change this, if people are interested.
Re: [pygame] pygame to android
Tom, what is the relationship between RenPy and Pygame? regards, tom .. Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency. On 7/21/15, Tom Rothamel t...@rothamel.us wrote: Pygame_sdl2, as packaged with RAPT is probably the best solution - depending on if it supports the subset of pygame that you're using. I threw together a git repository that has a sample game that can be packaged. You can check it out at: https://github.com/renpytom/rapt-pygame-example The main.py in there shows how to handle the APP_WILLENTERBACKGROUND (sleep) and APP_DIDENTERFOREGROUND (resume) events, which most Android apps will want to handle. Hope this helps, and let me know if you're having trouble - this code works well with Ren'Py, but I don't think many people have tried it with more general Pygame code. On Tue, Jul 21, 2015 at 7:14 PM tom arnall kloro2...@gmail.com wrote: are there any people on this list who are big into porting pygame apps to android? --
Re: [pygame] pygame to android
Tom, thanks very much for the information. I'm sure i'll be back with more questions about it soon ;o) regards, Tom .. Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency. On 7/22/15, Tom Rothamel t...@rothamel.us wrote: On Wed, Jul 22, 2015 at 4:11 AM tom arnall kloro2...@gmail.com wrote: what is the relationship between RenPy and Pygame? Ren'Py is a game engine that people use to make specific types of generally narrative-heavy games. Visual Novels, Life Simulations, and simple RPGs are all within what Ren'Py was intended to help make. For ten years, Ren'Py was based on Pygame, to the point where the Pygame API is included in various places in the Ren'Py API. About a year ago, it became clear that SDL2 would be necessary for Ren'Py to keep supporting Android and add iOS support, so we wrote Pygame_sdl2, a reimplementation of the Pygame API over SDL2. (Pygame_sdl2 isn't complete, as it needs help from people who understand buffers and the pygame test suite.) Ren'Py has a number of tools that are used to package games for mobile platforms - RAPT is used for Android, while Renios is used for iOS. These tools are generally written in a way that they can be used to package arbitrary games written using pygame_sdl2. Ren'Py itself also comes with a launcher that can one-click package a Ren'Py game for Windows, Mac OS X, and Linux - with a few more clicks, it also takes care of Android and iOS packaging. This isn't designed to work with arbitrary pygame code, but could plausibly be changed to do so. Due to terrible social skills, I haven't really contributed much of this Ren'Py work back to pygame - and the one project I did contribute, pygs4a, turned out to be a technological dead end. I'm trying to change this, if people are interested. --
Re: [pygame] pygame to android
And pygame_sdl2 is far from ready - there's no test suite, for example. what happened to write tests first! ? On 7/22/15, Tom Rothamel t...@rothamel.us wrote: On Wed, Jul 22, 2015 at 4:37 PM Luke Paireepinart rabidpoob...@gmail.com wrote: Tom, Is sdl2 Pygame the way forward for Pygame? I think it is - but I'm biased about this. And pygame_sdl2 is far from ready - there's no test suite, for example. All I can say is that I need/plan to maintain pygame_sdl2 indefinitely to support Ren'Py. (Or at least until a better implementation of the Pygame API comes about.) I would be interested in assisting with a generic Pygame packager for cross platform applications. Where would we get started in doing that, to separate it from Ren'Py in a generic way? I'd suggest grabbing a copy of the Ren'Py SDK (from www.renpy.org), creating a new project, and building distributions of it, just to get a feel for what the tools can do in terms of installing text editors and packaging games for various platforms. My thinking is the right thing to would be to modify the Ren'Py launcher so that it can be rebranded and released as a pygame tool, as opposed to trying to make something standalone. This is for pragmatic reasons - maintaining a split version would be more ongoing work that coming up with a variant of the launcher that can launch and package arbitrary pygame apps. That being said, all the Ren'Py packager does is to copy various files into zip or tar.bz2 files with appropriate permissions info, so if someone wants to make a standalone tool or distribution, they can. -- .. Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency.
Re: [pygame] pygame to android
The theory is that pygame_sdl2 will be able to run the pygame test suite at some point. On Wed, Jul 22, 2015 at 9:30 PM tom arnall kloro2...@gmail.com wrote: And pygame_sdl2 is far from ready - there's no test suite, for example. what happened to write tests first! ? On 7/22/15, Tom Rothamel t...@rothamel.us wrote: On Wed, Jul 22, 2015 at 4:37 PM Luke Paireepinart rabidpoob...@gmail.com wrote: Tom, Is sdl2 Pygame the way forward for Pygame? I think it is - but I'm biased about this. And pygame_sdl2 is far from ready - there's no test suite, for example. All I can say is that I need/plan to maintain pygame_sdl2 indefinitely to support Ren'Py. (Or at least until a better implementation of the Pygame API comes about.) I would be interested in assisting with a generic Pygame packager for cross platform applications. Where would we get started in doing that, to separate it from Ren'Py in a generic way? I'd suggest grabbing a copy of the Ren'Py SDK (from www.renpy.org), creating a new project, and building distributions of it, just to get a feel for what the tools can do in terms of installing text editors and packaging games for various platforms. My thinking is the right thing to would be to modify the Ren'Py launcher so that it can be rebranded and released as a pygame tool, as opposed to trying to make something standalone. This is for pragmatic reasons - maintaining a split version would be more ongoing work that coming up with a variant of the launcher that can launch and package arbitrary pygame apps. That being said, all the Ren'Py packager does is to copy various files into zip or tar.bz2 files with appropriate permissions info, so if someone wants to make a standalone tool or distribution, they can. -- .. Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency.
Re: [pygame] pygame to android
On Wed, Jul 22, 2015 at 4:11 AM tom arnall kloro2...@gmail.com wrote: what is the relationship between RenPy and Pygame? Ren'Py is a game engine that people use to make specific types of generally narrative-heavy games. Visual Novels, Life Simulations, and simple RPGs are all within what Ren'Py was intended to help make. For ten years, Ren'Py was based on Pygame, to the point where the Pygame API is included in various places in the Ren'Py API. About a year ago, it became clear that SDL2 would be necessary for Ren'Py to keep supporting Android and add iOS support, so we wrote Pygame_sdl2, a reimplementation of the Pygame API over SDL2. (Pygame_sdl2 isn't complete, as it needs help from people who understand buffers and the pygame test suite.) Ren'Py has a number of tools that are used to package games for mobile platforms - RAPT is used for Android, while Renios is used for iOS. These tools are generally written in a way that they can be used to package arbitrary games written using pygame_sdl2. Ren'Py itself also comes with a launcher that can one-click package a Ren'Py game for Windows, Mac OS X, and Linux - with a few more clicks, it also takes care of Android and iOS packaging. This isn't designed to work with arbitrary pygame code, but could plausibly be changed to do so. Due to terrible social skills, I haven't really contributed much of this Ren'Py work back to pygame - and the one project I did contribute, pygs4a, turned out to be a technological dead end. I'm trying to change this, if people are interested.
Re: [pygame] pygame to android
Um... basically, the docs are out of date, and since pgs4a was a technological dead-end from the start (it used a private fork of SDL1), efforts to update its documentation are kind of wasted. On Wed, Jul 22, 2015 at 12:00 AM tom arnall kloro2...@gmail.com wrote: Tom thanks very much! btw at: http://pygame.renpy.org/android-packaging.html there are instructions for putting a pygame application into an apk, but there is no mention of what must be done to the pygame application code to make it android-ready. For exampe, there is no mention of 'import android'. why is this? regards, Tom Arnall .. Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency. On 7/21/15, Tom Rothamel t...@rothamel.us wrote: Pygame_sdl2, as packaged with RAPT is probably the best solution - depending on if it supports the subset of pygame that you're using. I threw together a git repository that has a sample game that can be packaged. You can check it out at: https://github.com/renpytom/rapt-pygame-example The main.py in there shows how to handle the APP_WILLENTERBACKGROUND (sleep) and APP_DIDENTERFOREGROUND (resume) events, which most Android apps will want to handle. Hope this helps, and let me know if you're having trouble - this code works well with Ren'Py, but I don't think many people have tried it with more general Pygame code. On Tue, Jul 21, 2015 at 7:14 PM tom arnall kloro2...@gmail.com wrote: are there any people on this list who are big into porting pygame apps to android? --
Re: [pygame] pygame to android
Pygame_sdl2, as packaged with RAPT is probably the best solution - depending on if it supports the subset of pygame that you're using. I threw together a git repository that has a sample game that can be packaged. You can check it out at: https://github.com/renpytom/rapt-pygame-example The main.py in there shows how to handle the APP_WILLENTERBACKGROUND (sleep) and APP_DIDENTERFOREGROUND (resume) events, which most Android apps will want to handle. Hope this helps, and let me know if you're having trouble - this code works well with Ren'Py, but I don't think many people have tried it with more general Pygame code. On Tue, Jul 21, 2015 at 7:14 PM tom arnall kloro2...@gmail.com wrote: are there any people on this list who are big into porting pygame apps to android?
Re: [pygame] pygame to android
Tom thanks very much! btw at: http://pygame.renpy.org/android-packaging.html there are instructions for putting a pygame application into an apk, but there is no mention of what must be done to the pygame application code to make it android-ready. For exampe, there is no mention of 'import android'. why is this? regards, Tom Arnall .. Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency. On 7/21/15, Tom Rothamel t...@rothamel.us wrote: Pygame_sdl2, as packaged with RAPT is probably the best solution - depending on if it supports the subset of pygame that you're using. I threw together a git repository that has a sample game that can be packaged. You can check it out at: https://github.com/renpytom/rapt-pygame-example The main.py in there shows how to handle the APP_WILLENTERBACKGROUND (sleep) and APP_DIDENTERFOREGROUND (resume) events, which most Android apps will want to handle. Hope this helps, and let me know if you're having trouble - this code works well with Ren'Py, but I don't think many people have tried it with more general Pygame code. On Tue, Jul 21, 2015 at 7:14 PM tom arnall kloro2...@gmail.com wrote: are there any people on this list who are big into porting pygame apps to android? --
Re: [pygame] pygame to android
Try kivy On Tue, Jul 21, 2015 at 7:14 PM tom arnall kloro2...@gmail.com wrote: are there any people on this list who are big into porting pygame apps to android?
[pygame] pygame to android
are there any people on this list who are big into porting pygame apps to android?
Re: [pygame] Pygame for Android question: videos possible?
Ask on the forum for pygs4a... Or submit an issue there :) On Oct 29, 2012 8:28 PM, Alec Bennett wrybr...@gmail.com wrote: I need to do an Android project that simply plays one of five videos, and I was considering using Pygame for it. I was wondering if this would be possible? Can I play fullscreen video using Pygame on Android? I'd be using the Google Nexus 7, if that's a factor. The video can be in whatever format is required.
Re: [pygame] Pygame for Android question: videos possible?
On Mon, Oct 29, 2012 at 3:29 PM, Noel Garwick noel.garw...@gmail.comwrote: As far as I know, video support is still missing for Pygame subset for Android. Can anyone think of a way to work around this issue? Maybe a way to play video as an external process? Or would it be hard to add video support to the Pygame subset for Android?
Re: [pygame] Pygame for Android question: videos possible?
I think that devs are waiting for the next version of SDL before they implement it. You could always do it manually; blit a series of images to a surface, while playing the soundtrack using pygame's mixer module. I did this (using ffmpeg to extract still frames / audio track, along with a script to try and remove redundant frames to reduce file size) to get some renpy games working on android and it worked pretty well. On Thu, Nov 1, 2012 at 12:32 PM, Alec Bennett wrybr...@gmail.com wrote: On Mon, Oct 29, 2012 at 3:29 PM, Noel Garwick noel.garw...@gmail.comwrote: As far as I know, video support is still missing for Pygame subset for Android. Can anyone think of a way to work around this issue? Maybe a way to play video as an external process? Or would it be hard to add video support to the Pygame subset for Android?
[pygame] Pygame for Android question: videos possible?
I need to do an Android project that simply plays one of five videos, and I was considering using Pygame for it. I was wondering if this would be possible? Can I play fullscreen video using Pygame on Android? I'd be using the Google Nexus 7, if that's a factor. The video can be in whatever format is required.
Re: [pygame] Pygame for Android question: videos possible?
As far as I know, video support is still missing for Pygame subset for Android. On Mon, Oct 29, 2012 at 4:28 PM, Alec Bennett wrybr...@gmail.com wrote: I need to do an Android project that simply plays one of five videos, and I was considering using Pygame for it. I was wondering if this would be possible? Can I play fullscreen video using Pygame on Android? I'd be using the Google Nexus 7, if that's a factor. The video can be in whatever format is required.
[pygame] pygame on android first impressions
I just set up pygame for android on my LG Optimus phone. The documentation is good! The process worked pretty much as advertised. Looks like my phone is not really strong enough to run the app well though. The simple 'flash green' application on the P4A website isn't too fast... there is a 0.5-1s latency with the flash feature. I'm thinking this is just inherent to running an interpreted language on a slow mobile phone processor. Does that sound right? So it looks like a cool tool, but I think the phone is just not a good graphical Python environment. Any thoughts? Thanks yall -- A musician must make music, an artist must paint, a poet must write, if he is to be ultimately at peace with himself. - Abraham Maslow
Re: [pygame] pygame on android first impressions
I have been playing with the pygame subset for android on a Motorola Xoom tablet. it is faster than most phones, but I did notice that the slowest stuff seemed to be graphics. Have you tested a pygame program with a very low screen resolution like 320x240? I would be curious how it runs on your phone. I tried to do profiling on my Android device. The cProfile module didn't work, but the profile module did, unfortunately it is so much slower than the cProfile module, so it was difficult to test with on the Android device. --- James Paige On Thu, Oct 20, 2011 at 04:28:45PM -0200, Sean Wolfe wrote: I just set up pygame for android on my LG Optimus phone. The documentation is good! The process worked pretty much as advertised. Looks like my phone is not really strong enough to run the app well though. The simple 'flash green' application on the P4A website isn't too fast... there is a 0.5-1s latency with the flash feature. I'm thinking this is just inherent to running an interpreted language on a slow mobile phone processor. Does that sound right? So it looks like a cool tool, but I think the phone is just not a good graphical Python environment. Any thoughts? Thanks yall -- A musician must make music, an artist must paint, a poet must write, if he is to be ultimately at peace with himself. - Abraham Maslow
Re: [pygame] pygame on android first impressions
I'm working on a Phantasy Star - type game in pygame, and I think I'll take a simple battle screen and try and port it to P4A. I'll set the graphics up for the lower resoltion and give it a shot. It will be a good learning project! Give me a little bit to get it all done and I'll message the group back with the results. On Thu, Oct 20, 2011 at 5:08 PM, James Paige b...@hamsterrepublic.com wrote: I have been playing with the pygame subset for android on a Motorola Xoom tablet. it is faster than most phones, but I did notice that the slowest stuff seemed to be graphics. Have you tested a pygame program with a very low screen resolution like 320x240? I would be curious how it runs on your phone. I tried to do profiling on my Android device. The cProfile module didn't work, but the profile module did, unfortunately it is so much slower than the cProfile module, so it was difficult to test with on the Android device. --- James Paige On Thu, Oct 20, 2011 at 04:28:45PM -0200, Sean Wolfe wrote: I just set up pygame for android on my LG Optimus phone. The documentation is good! The process worked pretty much as advertised. Looks like my phone is not really strong enough to run the app well though. The simple 'flash green' application on the P4A website isn't too fast... there is a 0.5-1s latency with the flash feature. I'm thinking this is just inherent to running an interpreted language on a slow mobile phone processor. Does that sound right? So it looks like a cool tool, but I think the phone is just not a good graphical Python environment. Any thoughts? Thanks yall -- A musician must make music, an artist must paint, a poet must write, if he is to be ultimately at peace with himself. - Abraham Maslow -- A musician must make music, an artist must paint, a poet must write, if he is to be ultimately at peace with himself. - Abraham Maslow
Re: [pygame] Pygame for Android
So, How would I put up my free game on the market?
Re: [pygame] Pygame for Android
Re: [pygame] Pygame for Android I am porting over a game. Will I be able to put it on the Android market? Thanks for all that you have done. I will send you feedback soon!
Re: [pygame] Pygame for Android
On Mon, Dec 20, 2010 at 4:12 PM, p...@eggplantanimation.com wrote: Re: [pygame] Pygame for Android I am porting over a game. Will I be able to put it on the Android market? Thanks for all that you have done. I will send you feedback soon! Yes. Right now, I'm still trying to get the packaging story figured out. At least right now, it's not ready for commercial games, but I think free ones are close to ready to go, once I upload the pygame subset package to the market. (I'm waiting for more testing feedback before uploading - it's a bit of a chicken-egg scenario for now.) Right now, the packaging test for Ren'Py is ongoing - you can see an example of what we have here: http://lemmasoft.renai.us/forums/viewtopic.php?f=32t=8673 Everything is pretty much parameterized so that tweaking a few strings is enough to get it working for pygame as well.
Re: [pygame] Pygame for Android
Hi, on the upcomming android you can write apps with zero java :) Of course that is on 0.01% of peoples devices so far... but still nice for later. If you're still looking at SDL-on-Android, you might want to check out the Gingerbread SDK/NDK, which now provides a mechanism for native apps that have access to libc, libm, libz, opengl|ES, opensl|ES, input/events/sensors, app/activity lifecycle, resources, etc, without the need to write any Java code. JNI is available for access to higher level Java APIs in the platform. http://developer.android.com/sdk/android-2.3.html http://developer.android.com/sdk/ndk/index.html http://developer.android.com/reference/android/app/NativeActivity.html On Mon, Dec 6, 2010 at 6:01 PM, Lenard Lindstrom le...@telus.net wrote: Hi Tom, On 06/12/10 09:35 AM, Tom Rothamel wrote: On Mon, Dec 6, 2010 at 11:16 AM, stas zytkiewicz stas.zytkiew...@gmail.com mailto:stas.zytkiew...@gmail.com wrote: Are you planning to eventually port the pygame.mixer ? I'm not sure what the strategy for this would be. At the very least, I'll document the sound playback code I have now - and perhaps I'll try to write a compatibility layer. pygame.mixer wraps SDL_Mixer, which in turn provides a high level interface to SDL's sound interface. I believe SDL_mixer can be built without other dependencies such as SMPEG and ogg/vorbis. So if SDL audio works on the Android then pygame.mixer should work without changes. Lenard Lindstrom
Re: [pygame] Pygame for Android
On Mon, Dec 6, 2010 at 5:39 AM, Tom Rothamel t...@rothamel.us wrote: Again, this hasn't been tested on may devices - so feedback is encouraged. I'll try to get the full source code up shortly. I've tried it on the android emulator, 2.1-update1 API level 7 but it crashes hard: I/ActivityManager( 54): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x1020 cmp=org.renpy.pygame/.MainActivity } I/ActivityManager( 54): Start proc org.renpy.pygame for activity org.renpy.pygame/.MainActivity: pid=237 uid=10024 gids={1015} I/ARMAssembler( 54): generated scanline__0177:03515104_0001_ [ 73 ipp] (95 ins) at [0x4aa138:0x4aa2b4] in 1616748 ns D/dalvikvm( 237): Trying to load lib /data/data/org.renpy.pygame/lib/libsdl.so 0x44dab0b8 D/dalvikvm( 237): Added shared lib /data/data/org.renpy.pygame/lib/libsdl.so 0x44dab0b8 D/dalvikvm( 237): Trying to load lib /data/data/org.renpy.pygame/lib/libsdl_image.so 0x44dab0b8 D/dalvikvm( 237): Added shared lib /data/data/org.renpy.pygame/lib/libsdl_image.so 0x44dab0b8 D/dalvikvm( 237): No JNI_OnLoad found in /data/data/org.renpy.pygame/lib/libsdl_image.so 0x44dab0b8 D/dalvikvm( 237): Trying to load lib /data/data/org.renpy.pygame/lib/libsdl_ttf.so 0x44dab0b8 D/dalvikvm( 237): Added shared lib /data/data/org.renpy.pygame/lib/libsdl_ttf.so 0x44dab0b8 D/dalvikvm( 237): No JNI_OnLoad found in /data/data/org.renpy.pygame/lib/libsdl_ttf.so 0x44dab0b8 I/python ( 237): Trying to load libpython2.6.so D/libEGL ( 237): egl.cfg not found, using default config I/ActivityManager( 54): Displayed activity org.renpy.pygame/.MainActivity: 3838 ms (total 3838 ms) D/libEGL ( 237): loaded /system/lib/egl/libGLES_android.so I/ARMAssembler( 54): generated scanline__0077:03545404_0A04_ [ 29 ipp] (51 ins) at [0x4acac8:0x4acb94] in 1504792 ns E/gralloc ( 54): [unregister] handle 0x4c0690 still locked (state=4001) D/dalvikvm( 237): +++ not scanning '/system/lib/libwebcore.so' for 'nativeResize' (wrong CL) D/dalvikvm( 237): +++ not scanning '/system/lib/libexif.so' for 'nativeResize' (wrong CL) I/libSDL ( 237): Physical screen resolution is 480x800 D/dalvikvm( 237): GC freed 692 objects / 56008 bytes in 217ms I/ARMAssembler( 237): generated scanline__0077:03010103_0A04_ [ 22 ipp] (44 ins) at [0x2d1e78:0x2d1f28] in 2659542 ns I/ARMAssembler( 237): generated scanline__0177:03010144_9503_ [ 62 ipp] (105 ins) at [0x2d1f30:0x2d20d4] in 4309535 ns D/dalvikvm( 237): Trying to load lib /data/data/org.renpy.pygame/files/libpython2.6.so 0x44dab0b8 D/dalvikvm( 237): Added shared lib /data/data/org.renpy.pygame/files/libpython2.6.so 0x44dab0b8 D/dalvikvm( 237): No JNI_OnLoad found in /data/data/org.renpy.pygame/files/libpython2.6.so 0x44dab0b8 D/dalvikvm( 237): Trying to load lib /data/data/org.renpy.pygame/lib/libapplication.so 0x44dab0b8 D/dalvikvm( 237): Added shared lib /data/data/org.renpy.pygame/lib/libapplication.so 0x44dab0b8 D/dalvikvm( 237): No JNI_OnLoad found in /data/data/org.renpy.pygame/lib/libapplication.so 0x44dab0b8 D/dalvikvm( 237): Trying to load lib /data/data/org.renpy.pygame/lib/libsdl_main.so 0x44dab0b8 D/dalvikvm( 237): Added shared lib /data/data/org.renpy.pygame/lib/libsdl_main.so 0x44dab0b8 D/dalvikvm( 237): No JNI_OnLoad found in /data/data/org.renpy.pygame/lib/libsdl_main.so 0x44dab0b8 I/python ( 237): Using files directory: /data/data/org.renpy.pygame/files V/RenPy ( 237): Extracting assets... D/dalvikvm( 237): GC freed 289 objects / 80832 bytes in 232ms I/dalvikvm-heap( 237): Grow heap (frag case) to 4.953MB for 1048592-byte allocation D/dalvikvm( 237): GC freed 41 objects / 1592 bytes in 241ms D/dalvikvm( 99): GC freed 573 objects / 31376 bytes in 6388ms D/dalvikvm( 237): +++ not scanning '/system/lib/libwebcore.so' for 'nativeInitJavaCallbacks' (wrong CL) D/dalvikvm( 237): +++ not scanning '/system/lib/libexif.so' for 'nativeInitJavaCallbacks' (wrong CL) D/dalvikvm( 237): +++ not scanning '/system/lib/libwebcore.so' for 'nativeSetEnv' (wrong CL) D/dalvikvm( 237): +++ not scanning '/system/lib/libexif.so' for 'nativeSetEnv' (wrong CL) D/dalvikvm( 237): +++ not scanning '/system/lib/libwebcore.so' for 'nativeSetMouseUsed' (wrong CL) D/dalvikvm( 237): +++ not scanning '/system/lib/libexif.so' for 'nativeSetMouseUsed' (wrong CL) D/dalvikvm( 237): +++ not scanning '/system/lib/libwebcore.so' for 'nativeInit' (wrong CL) D/dalvikvm( 237): +++ not scanning '/system/lib/libexif.so' for 'nativeInit' (wrong CL) I/python ( 237): Private directory is /data/data/org.renpy.pygame/files I/python ( 237): Public directory is /sdcard/pygame I/python ( 237): Handing off to main. I/python ( 237): /sdcard/pygame/main.py:1: RuntimeWarning: import cdrom: No module named cdrom I/python ( 237): (ImportError: No module named cdrom) I/python ( 237): import pygame I/libSDL ( 237): SDL_SetVideoMode(): application
Re: [pygame] Pygame for Android
On 6 December 2010 04:39, Tom Rothamel t...@rothamel.us wrote: Hi. I'm the creator of the Ren'Py visual novel engine (http://www.renpy.org), a tool for digital storytelling. Ren'Py has been using Pygame since at least 2004. For the past month or so, I've been porting Ren'Py to the Android platform. A few days ago, I had the first success. This required porting Python and Pygame to Android. (I used an existing port of SDL to Android.) As I don't believe I've seen a port of Pygame to Android, I thought it would be useful if I broke out the pygame support into its own distribution. The result is Pygame for Android, which can be downloaded from: http://www.renpy.org/android-test/pygame_for_android-1.0.zip Despite the number in the URL, this is far from a 1.0 release, having just begun testing. There is essentially nothing in the way of documentation or error handling - I'm releasing this publicly just to show that the project has begun. It requires an Android 2.0 or higher device, with working OpenGL support. To use it, unzip the zip file, install PygameLauncher-debug.apk on your device, and copy the pygame/ directory to the root of the device's sd card. Then run the launcher icon. After showing the Pygame logo for a few seconds, a small test program is loaded and run. The test program can be changed by editing /pygame/main.py on the sdcard. main.py is imported as a module, and then has its main function called - so code should live in the main function. The main.py file has a few comments in it. The functionality included is largely selected by what I use in Ren'Py. Most notably, the mixer module is not included - the android_sound module uses the Android media player code, which potentially might use hardware acceleration. My eventual plan for this, apart from bug-fixes and documentation, is to put together a launcher, that allows users to select from projects that live on the SD card. Again, this hasn't been tested on may devices - so feedback is encouraged. I'll try to get the full source code up shortly. The following modules are available in this release, although many of them have not been tested thoroughly. android android_sound pygame.base pygame.bufferproxy pygame.colordict pygame.color pygame.compat pygame.constants pygame.cursors pygame.display pygame.draw pygame.event pygame.fastevent pygame.font pygame.gfxdraw pygame.imageext pygame.image pygame.__init__ pygame.joystick pygame.key pygame.locals pygame.mask pygame.mouse pygame.overlay pygame.rect pygame.rwobject pygame.sprite pygame.surface pygame.surflock pygame.sysfont pygame.time pygame.transform pygame.version _abcoll abc aliases array ast atexit base64 bisect binascii calendar cmath codecs collections compileall contextlib copy copy_reg cStringIO cPickle datetime difflib dis dummy_threading dummy_thread encodings.__init__ encodings.raw_unicode_escape encodings.utf_8 encodings.zlib_codec errno fcntl fnmatch functools __future__ genericpath getopt glob gzip hashlib heapq inspect itertools keyword linecache math md5 opcode optparse os operator parser pickle platform posix posixpath pprint py_compile pwd Queue random repr re select sets shlex shutil site socket sre_compile sre_constants sre_parse ssl stat StringIO string struct subprocess symbol symtable strop tarfile tempfile textwrap _threading_local threading time tokenize token traceback types UserDict warnings weakref webbrowser zipfile zipimport zlib Wow, super cool - I guess it has python inside it? Is it now possible to make android apps with python like this ?
Re: [pygame] Pygame for Android
On Mon, Dec 6, 2010 at 4:49 PM, Stuart Axon stu.axon+pyg...@gmail.com wrote: On 6 December 2010 04:39, Tom Rothamel t...@rothamel.us wrote: For the past month or so, I've been porting Ren'Py to the Android platform. A few days ago, I had the first success. This required porting Python and Pygame to Android. (I used an existing port of SDL to Android.) As I don't believe I've seen a port of Pygame to Android, I thought it would be useful if I broke out the pygame support into its own distribution. [..] Wow, super cool - I guess it has python inside it? Agreed, great news :-) I was just looking for ways to get my pygame-based projects to run on android. Are you planning to eventually port the pygame.mixer ? Anyway, good work. I will try to get my hands on some android apps to test it. Greetings, Stas -- Free-source educational programs for schools http://www.schoolsplay.org and http://wiki.laptop.org/go/Schoolsplay http://gvr.sf.net and http://wiki.laptop.org/go/Guido_van_Robot
Re: [pygame] Pygame for Android
Amazing! This is really cool. It would be good to merge your changes in to pygame subversion. Do you already have subversion access? cheers, On Mon, Dec 6, 2010 at 4:39 AM, Tom Rothamel t...@rothamel.us wrote: Hi. I'm the creator of the Ren'Py visual novel engine (http://www.renpy.org), a tool for digital storytelling. Ren'Py has been using Pygame since at least 2004. For the past month or so, I've been porting Ren'Py to the Android platform. A few days ago, I had the first success. This required porting Python and Pygame to Android. (I used an existing port of SDL to Android.) As I don't believe I've seen a port of Pygame to Android, I thought it would be useful if I broke out the pygame support into its own distribution. The result is Pygame for Android, which can be downloaded from: http://www.renpy.org/android-test/pygame_for_android-1.0.zip Despite the number in the URL, this is far from a 1.0 release, having just begun testing. There is essentially nothing in the way of documentation or error handling - I'm releasing this publicly just to show that the project has begun. It requires an Android 2.0 or higher device, with working OpenGL support. To use it, unzip the zip file, install PygameLauncher-debug.apk on your device, and copy the pygame/ directory to the root of the device's sd card. Then run the launcher icon. After showing the Pygame logo for a few seconds, a small test program is loaded and run. The test program can be changed by editing /pygame/main.py on the sdcard. main.py is imported as a module, and then has its main function called - so code should live in the main function. The main.py file has a few comments in it. The functionality included is largely selected by what I use in Ren'Py. Most notably, the mixer module is not included - the android_sound module uses the Android media player code, which potentially might use hardware acceleration. My eventual plan for this, apart from bug-fixes and documentation, is to put together a launcher, that allows users to select from projects that live on the SD card. Again, this hasn't been tested on may devices - so feedback is encouraged. I'll try to get the full source code up shortly. The following modules are available in this release, although many of them have not been tested thoroughly. android android_sound pygame.base pygame.bufferproxy pygame.colordict pygame.color pygame.compat pygame.constants pygame.cursors pygame.display pygame.draw pygame.event pygame.fastevent pygame.font pygame.gfxdraw pygame.imageext pygame.image pygame.__init__ pygame.joystick pygame.key pygame.locals pygame.mask pygame.mouse pygame.overlay pygame.rect pygame.rwobject pygame.sprite pygame.surface pygame.surflock pygame.sysfont pygame.time pygame.transform pygame.version _abcoll abc aliases array ast atexit base64 bisect binascii calendar cmath codecs collections compileall contextlib copy copy_reg cStringIO cPickle datetime difflib dis dummy_threading dummy_thread encodings.__init__ encodings.raw_unicode_escape encodings.utf_8 encodings.zlib_codec errno fcntl fnmatch functools __future__ genericpath getopt glob gzip hashlib heapq inspect itertools keyword linecache math md5 opcode optparse os operator parser pickle platform posix posixpath pprint py_compile pwd Queue random repr re select sets shlex shutil site socket sre_compile sre_constants sre_parse ssl stat StringIO string struct subprocess symbol symtable strop tarfile tempfile textwrap _threading_local threading time tokenize token traceback types UserDict warnings weakref webbrowser zipfile zipimport zlib
Re: [pygame] Pygame for Android
On Mon, Dec 6, 2010 at 10:49 AM, Stuart Axon stu.axon+pyg...@gmail.comstu.axon%2bpyg...@gmail.com wrote: Wow, super cool - I guess it has python inside it? Is it now possible to make android apps with python like this ? Yes. The basic strategy is to use JNI to communicate between Python and Dalvik. libpython2.6 is distributed as part of the package, along with pygame. For now, the launcher is an app that runs code it finds on the sdcard. At some point, I'll try to add the ability to bundle the launcher and a project together as a single app. (This is made a little difficult by android changing the names of certain classes it generates based on the name of the application.) On Mon, Dec 6, 2010 at 11:16 AM, stas zytkiewicz stas.zytkiew...@gmail.com wrote: Are you planning to eventually port the pygame.mixer ? I'm not sure what the strategy for this would be. At the very least, I'll document the sound playback code I have now - and perhaps I'll try to write a compatibility layer. René Dudfield wrote: It would be good to merge your changes in to pygame subversion. Do you already have subversion access? I don't, but I don't think it's necessary - there weren't any changes to pygame required. Once SDL and Python work on a platform, pygame works as well. I've released a version 0.2 to: http://www.renpy.org/android-test/pygame_for_android-0.2.zip (Let's retroactively call the first version version 0.1.) This fixes a local reference leak in the sound code which would cause a crash after 255 sounds were played. I've also put the source code up at: https://code.launchpad.net/~renpytom/renpy/pygame-for-android Well, this is less source code, and more a collection of build scripts and various other project files that are required to convince everything to cross-compile and play well together.
Re: [pygame] Pygame for Android
Hi Tom, On 06/12/10 09:35 AM, Tom Rothamel wrote: On Mon, Dec 6, 2010 at 11:16 AM, stas zytkiewicz stas.zytkiew...@gmail.com mailto:stas.zytkiew...@gmail.com wrote: Are you planning to eventually port the pygame.mixer ? I'm not sure what the strategy for this would be. At the very least, I'll document the sound playback code I have now - and perhaps I'll try to write a compatibility layer. pygame.mixer wraps SDL_Mixer, which in turn provides a high level interface to SDL's sound interface. I believe SDL_mixer can be built without other dependencies such as SMPEG and ogg/vorbis. So if SDL audio works on the Android then pygame.mixer should work without changes. Lenard Lindstrom
[pygame] Pygame for Android
Hi. I'm the creator of the Ren'Py visual novel engine (http://www.renpy.org), a tool for digital storytelling. Ren'Py has been using Pygame since at least 2004. For the past month or so, I've been porting Ren'Py to the Android platform. A few days ago, I had the first success. This required porting Python and Pygame to Android. (I used an existing port of SDL to Android.) As I don't believe I've seen a port of Pygame to Android, I thought it would be useful if I broke out the pygame support into its own distribution. The result is Pygame for Android, which can be downloaded from: http://www.renpy.org/android-test/pygame_for_android-1.0.zip Despite the number in the URL, this is far from a 1.0 release, having just begun testing. There is essentially nothing in the way of documentation or error handling - I'm releasing this publicly just to show that the project has begun. It requires an Android 2.0 or higher device, with working OpenGL support. To use it, unzip the zip file, install PygameLauncher-debug.apk on your device, and copy the pygame/ directory to the root of the device's sd card. Then run the launcher icon. After showing the Pygame logo for a few seconds, a small test program is loaded and run. The test program can be changed by editing /pygame/main.py on the sdcard. main.py is imported as a module, and then has its main function called - so code should live in the main function. The main.py file has a few comments in it. The functionality included is largely selected by what I use in Ren'Py. Most notably, the mixer module is not included - the android_sound module uses the Android media player code, which potentially might use hardware acceleration. My eventual plan for this, apart from bug-fixes and documentation, is to put together a launcher, that allows users to select from projects that live on the SD card. Again, this hasn't been tested on may devices - so feedback is encouraged. I'll try to get the full source code up shortly. The following modules are available in this release, although many of them have not been tested thoroughly. android android_sound pygame.base pygame.bufferproxy pygame.colordict pygame.color pygame.compat pygame.constants pygame.cursors pygame.display pygame.draw pygame.event pygame.fastevent pygame.font pygame.gfxdraw pygame.imageext pygame.image pygame.__init__ pygame.joystick pygame.key pygame.locals pygame.mask pygame.mouse pygame.overlay pygame.rect pygame.rwobject pygame.sprite pygame.surface pygame.surflock pygame.sysfont pygame.time pygame.transform pygame.version _abcoll abc aliases array ast atexit base64 bisect binascii calendar cmath codecs collections compileall contextlib copy copy_reg cStringIO cPickle datetime difflib dis dummy_threading dummy_thread encodings.__init__ encodings.raw_unicode_escape encodings.utf_8 encodings.zlib_codec errno fcntl fnmatch functools __future__ genericpath getopt glob gzip hashlib heapq inspect itertools keyword linecache math md5 opcode optparse os operator parser pickle platform posix posixpath pprint py_compile pwd Queue random repr re select sets shlex shutil site socket sre_compile sre_constants sre_parse ssl stat StringIO string struct subprocess symbol symtable strop tarfile tempfile textwrap _threading_local threading time tokenize token traceback types UserDict warnings weakref webbrowser zipfile zipimport zlib