Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- try:
- import android
- except ImportError:
- android = None
- def main():
- pygame.init()
- screen = pygame.display.set_mode((480, 800))
- if android:
- android.init()
- android.map_key(android.KEYCODE_BACK, pygame.K_ESCAPE)
- font = pygame.font.Font('freesansbold.ttf', 24)
- pygame.time.set_timer(pygame.USEREVENT, 100)
- text = font.render('Test', 1, (255, 255, 255))
- while True:
- ev = pygame.event.wait()
- if android:
- if android.check_pause():
- android.wait_for_resume()
- if ev.type == pygame.USEREVENT:
- screen.fill((0, 0, 0))
- screen.blit(text, (50, 50))
- pygame.display.flip()
- elif ev.type == pygame.KEYDOWN and ev.key == pygame.K_ESCAPE:
- break
- elif ev.type == pygame.QUIT:
- break
- pygame.quit()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement