demo-04-20/casioplot.py

21 lines
515 B
Python

# casioplot.py
import pygame
pygame.init()
screen_width = 384
screen_height = 192
screen = pygame.display.set_mode((screen_width, screen_height))
draw_string = print
def set_pixel(x, y, color):
pygame.draw.rect(screen, color, pygame.Rect(x, y, 1, 1))
def get_pixel(x, y):
if x >= screen_width or y >= screen_height or x < 0 or y < 0:
return None
return screen.get_at((x, y))[:2]
def clear_screen():
screen.fill((255,255,255))
show_screen()
def show_screen():
pygame.display.flip()