[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] android pygame app not functioning
- To: pygame-users@xxxxxxxx
- Subject: [pygame] android pygame app not functioning
- From: tom arnall <kloro2006@xxxxxxxxx>
- Date: Sat, 13 Jun 2015 21:47:32 -0700
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sun, 14 Jun 2015 00:47:35 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=OtCGueo6fQxq/AYN+bpQzl9hDwJufOVRGWKbxVQM6ys=; b=ez5WIvV+qNRI7UfduEgvfYgCPmQXflS3IiwkVTnzzUoWFP1DnRPyZ/800wVcG6JGyZ K/RUxpbgGkwee/gbbqqTK8aGXKx1qdlmmGhU2NWt7wsWDGgxsJ/3rConAzqXm5bgkgtT 0LbOJo6i55Mfx2NLE8uDC1VANFkDV8Sus43azs/CKXzzn6F+nw6I30by6ggIMw7xQ28V JV0xCvLYlT8yvIJKL1pNMoS0TqCFn2SI+FhOMEUyeG6MbcFrSeu0rFE85EaiJdk4Ynw/ nLtsYl+LK17nE0ictDLhucetUMW4FRA4/yEp4KrVWa0Gx12QEjAVgYjlR5kU638LOfOV Xe+g==
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I am able to get the following code to build and create apk, following
the instructions at http://pygame.renpy.org/android-packaging.html. It
installs normally on the android device, but when I run it flashes
junk and goes away. The only abnormal things I can see are when it
configures and builds:
pgs4a-0.9.4/$./android.py configure apps/test
buildlib/jinja2.egg/jinja2/__init__.py:31: UserWarning: Module
colorama was already imported from buildlib/colorama/__init__.pyc, but
/usr/lib/python2.7/dist-packages is being added to sys.path
__version__ = __import__('pkg_resources') \
pgs4a-0.9.4/$ ./android.py build apps/test/ release
buildlib/jinja2.egg/jinja2/__init__.py:31: UserWarning: Module
colorama was already imported from buildlib/colorama/__init__.pyc, but
/usr/lib/python2.7/dist-packages is being added to sys.path
__version__ = __import__('pkg_resources') \
Here is the code:
import pygame
import pygame.font
import pygame.event
import pygame.draw
import string
from pygame.locals import *
black=(0,0,0)
green=(0,255,0)
#Tne next step is to make a function to create the display box.
def display_box(screen,mess):
fontobject = pygame.font.Font(None,18)
pygame.draw.rect(screen,black,((screen.get_width() / 2) - 100,
(screen.get_height() / 2) - 10,200,20), 0)
pygame.draw.rect(screen,green,((screen.get_width() / 2) - 101,
(screen.get_height() / 2) - 11,200,20), 1)
if len(mess) != 0:
screen.blit(fontobject.render(mess, 1, (25,255,25)),
((screen.get_width() / 2) - 100, (screen.get_height() / 2) - 9))
pygame.display.flip()
#Let's start the pygame window and display the box.
if __name__ == '__main__':
pygame.init()
pygame.display.set_caption("Hello world")
screen = pygame.display.set_mode((320,240))
pygame.font.init()
mess = []
while 1:
display_box(screen,"Hello world text")
pygame.display.update()
pygame.time.delay(10)
for event in pygame.event.get():
if event.type in
(pygame.QUIT,pygame.KEYDOWN,pygame.MOUSEBUTTONDOWN):
raise SystemExit