Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/api/Sprite2.py
diff options
context:
space:
mode:
authorAlan Aguiar <alanjas@hotmail.com>2014-01-20 21:41:46 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2014-01-20 21:41:46 (GMT)
commitb0b1d81a5de43653ba22e1ddc934f0b20c0a55f7 (patch)
treea162173c6655dfca9fe53f7c8cb116886f34c445 /src/api/Sprite2.py
parentd15550a006da6d843646c1bfed042e735631c56c (diff)
remove deprecated imagemaster to simple csprite2
Diffstat (limited to 'src/api/Sprite2.py')
-rw-r--r--src/api/Sprite2.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/api/Sprite2.py b/src/api/Sprite2.py
index e19c510..7d11f10 100644
--- a/src/api/Sprite2.py
+++ b/src/api/Sprite2.py
@@ -34,8 +34,8 @@ class CSprite(pygame.sprite.Sprite):
self.mactive = False
self.mclicked = False
- self.mImageMaster = pygame.surface.Surface((0, 0), 0)
- self.image = self.mImageMaster.copy()
+ self.image = pygame.surface.Surface((0, 0), 0)
+ self.rect = self.image.get_rect()
def setRegistrationPointOffset(self, aOffsetX, aOffsetY):
self.mOffsetX = aOffsetX
@@ -94,7 +94,6 @@ class CSprite(pygame.sprite.Sprite):
self.setImage(Image.loadImage(aImageFilename, aIsTransparent))
def setImage(self, aImage):
- self.mImageMaster = aImage
self.image = aImage
self.rect = self.image.get_rect()
self.calculatePositionWithOffset()
@@ -168,11 +167,9 @@ class CSprite(pygame.sprite.Sprite):
return math.sqrt((dx * dx) + (dy * dy))
def destroy(self):
- self.mImageMaster = None
self.image = None
def calculatePositionWithOffset(self):
- self.rect = self.image.get_rect()
self.rect.x = self.mPos.getX() - self.mOffsetX
self.rect.y = self.mPos.getY() - self.mOffsetY
@@ -184,8 +181,7 @@ class CSprite(pygame.sprite.Sprite):
def getSize(self):
if self.image:
- rect = self.image.get_rect()
- return (rect[2], rect[3])
+ return (self.rect[2], self.rect[3])
else:
return (0,0)