demo-04-20/casioplot.py

21 lines
515 B
Python
Raw Normal View History

2020-04-28 12:37:53 +02:00
# casioplot.py
import pygame
pygame.init()
2020-04-28 15:15:57 +02:00
SCREEN_WIDTH = 384
SCREEN_HEIGHT = 192
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
2020-04-28 12:37:53 +02:00
draw_string = print
2020-04-28 12:37:53 +02:00
def set_pixel(x, y, color):
pygame.draw.rect(screen, color, pygame.Rect(x, y, 1, 1))
def get_pixel(x, y):
2020-04-28 15:15:57 +02:00
if x >= SCREEN_WIDTH or y >= SCREEN_HEIGHT or x < 0 or y < 0:
return None
return screen.get_at((x, y))[:2]
2020-04-28 12:37:53 +02:00
def clear_screen():
screen.fill((255,255,255))
show_screen()
def show_screen():
pygame.display.flip()