[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]



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)