import pygame, time, sys, random
from pygame.locals import *
pygame.init()
FPS = 24 # para esto de la animacion
pygame.display.set_caption('Programa de muestra de las caps Pygame')
pygame.mouse.set_cursor(*pygame.cursors.diamond)
fpsClock = pygame.time.Clock()
Black=(0,0,0)
White=(255,255,255)
Blue=(0,0,255)
Red=(0,255,0)
Green=(255,0,0)
Disp=pygame.display.set_mode((700,400))
Disp.fill(White)
rectAzul=pygame.draw.rect(Disp,Blue,(100,100,100,100))
print rectAzul
rAzul=pygame.Rect(rectAzul) #Necesario, para trabajarlo como Rect
(nx,ny)=rAzul.topleft()
#surfAzul = rAzul.get_rect()
while True:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
if event.type==MOUSEBUTTONDOWN:
rAzul.move((200,300))
rAzul.blit(rAzul,(200,300,100,100))
pygame.display.update()
fpsClock.tick(FPS)
No hay comentarios:
Publicar un comentario