root/src/image.py @ 17

Revision 17, 0.6 KB (checked in by jelinson, 2 years ago)

abstracted constants out; changed windowEntry element's api to all use (left,top) as first argument

Line 
1'''
2Created on Feb 11, 2012
3
4@author: TechTrek
5'''
6
7import pygame
8from pygame.locals import *
9
10class Image:
11    def __init__(self, pos, width, height, image):
12        self.image = image
13        self.pos = (self.left,self.top) = pos
14        self.width = width
15        self.height = height
16       
17    def render(self,surface):
18        imageSurface = pygame.transform.smoothscale(self.image,(self.width,self.height))
19        surface.blit(imageSurface,pygame.Rect(self.left,self.top,self.width,self.height))
20       
21    def getRect(self):
22        return self.image.get_rect()
Note: See TracBrowser for help on using the browser.