[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Re: having problem with font objects in pgs4a ports to android [SOLVED]
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Re: having problem with font objects in pgs4a ports to android [SOLVED]
- From: tom arnall <kloro2006@xxxxxxxxx>
- Date: Wed, 5 Aug 2015 15:32:32 -0700
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 05 Aug 2015 18:32:36 -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=VA8t6J7uwQLL5/DmtkJl2awS3zJINGnv80PAvTUweCs=; b=XwbTMGhD14qkj/Km+5VH5wtbGalOsPhNxuTEgPIGazT8HP5DJ0x9UjBevrmYfJZYny rWKSEL4uO30i9392Uh5MdWtZ7s4NSZFGjVphth+svGZ/a5MweuX2BnWRD7ImGz31XiJ6 YoiSKEdadF26YUvueSFfcFp3aejYsNOOWjIdGgrrE+wrfQR3hc7IBje0kjCvgeoqqxRq AbKh5wEt8ZAQwfOHJRBEUkwOI4xDMa/bai/TgXw14nkXwsEDjxfrWlD2EnnLjyQebmEm WIiGcMqDwJggmvGMGLAh4B9/jmTAlJUq0+XKcEldVuo971401yCDtBZbSTUvKFxl+lx5 A8dQ==
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Well, kind of solved. So far I can make text rendering work only by
doing display.flip() 3 times. But it's progress. Below is a bare bones
version of the solution. It works on my handhelds as well as on my PC.
Perhaps the only way to deal with the multiple flips problem is to
send three copies of the text surface Rect object to display.update().
I have eliminated everything in the code which is not necessary to
demonstrate getting the text display to work. I doubt the lack of
ref's to android wd work in my app of interest. Alternative ideas
respectfully requested.
=======
import pygame
import time
def stop(interval=3):
print "stopping >> " + str(interval)
time.sleep(interval)
pygame.init()
screen = pygame.display.set_mode((480, 800))
#if android:
#android.init()
font = pygame.font.Font('freesansbold.ttf', 44)
text = font.render('Test', 1, (255, 255, 255))
screen.fill((0, 0, 0))
screen.blit(text, (50, 50))
pygame.display.flip()
pygame.display.flip()
pygame.display.flip()
stop(3)