#! /usr/bin/env python import pygame from pygame.locals import * import gtk, sys BLANCO = (255, 255, 255) NEGRO = (0, 0, 0) class MiJuego(): def __init__(self): pass def juego_loop(self): pygame.init() global x, y, fuente, texto x = gtk.gdk.screen_width() y = gtk.gdk.screen_height() - 55 pygame.display.set_caption('Hello world!') fuente = pygame.font.SysFont(None, 48) texto = fuente.render('Hello world!', True, BLANCO, NEGRO) reloj = pygame.time.Clock() pantalla = pygame.display.get_surface() while 1: while gtk.events_pending(): gtk.main_iteration() for event in pygame.event.get(): if event.type == pygame.QUIT: exit("Juego finalizado") elif event.type == pygame.VIDEORESIZE: pygame.display.set_mode(event.size, pygame.RESIZABLE) pantalla.fill(NEGRO) pantalla.blit(texto, ((x / 2) - (x / 10), (y / 2) - (y / 10))) pygame.display.flip() # Try to stay at 30 FPS reloj.tick(30) if __name__ == "__main__": MiJuego()