From d6e391eeb2ae8dca1ec641cffd7d30e20b7072e5 Mon Sep 17 00:00:00 2001 From: Jason Rock Date: Fri, 20 Mar 2009 01:49:13 +0000 Subject: Rewrote the pygame code repeatedpic.py is a more pythonic/OO version of the origional drawxos. --- (limited to 'drawxos.py') diff --git a/drawxos.py b/drawxos.py index ac1b3cd..fcc6ed9 100644 --- a/drawxos.py +++ b/drawxos.py @@ -2,7 +2,9 @@ import os, sys import pygame from pygame.locals import * -def drawXOs(screen,image,x=3,y=3,backgroundColor=(255,255,255)): + +def drawXOs(image,x=3,y=3,backgroundColor=(255,255,255)): + screen = pygame.display.get_surface() (xsize,ysize) = screen.get_size() (xx,yy) = image.get_size() mult = min(float(xsize)/(xx*x),float(ysize)/(yy*y)) @@ -28,11 +30,11 @@ def drawXOs(screen,image,x=3,y=3,backgroundColor=(255,255,255)): def main(): pygame.init() - screen = pygame.display.set_mode((1280,1000)) + pygame.display.set_mode((1280,1000)) image = pygame.image.load("XO.png") - drawXOs(screen,image,100,50); + drawXOs(image,100,50); raw_input() -- cgit v0.9.1