source: src/image.py @ 17

Last change on this file since 17 was 17, checked in by jelinson, 4 years ago

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

File size: 574 bytes
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 repository browser.