From 844397191acef6a0c673548819796db14866c01f Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Thu, 14 May 2020 12:56:33 +0200 Subject: [PATCH] Added tooltips to getCoords and SetCoords --- src/entities/Entity.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/entities/Entity.py b/src/entities/Entity.py index 66c72ba..ef0d913 100644 --- a/src/entities/Entity.py +++ b/src/entities/Entity.py @@ -50,12 +50,24 @@ class Entity(pygame.sprite.Sprite): # Setters and getters for coords def getCoords(self, screenRelative=False): + """ + Get coordinates of this entity. + + :param screenRelative: If true, the returned coords will be absolute. (default=False) + :return: A tuple of (x,y) coords. + """ if screenRelative: return self.rect.x, self.rect.y else: return self.x, self.y def setCoords(self, coords, screenRelative=False): + """ + Sets coords of this entity. + + :param coords: A tuple containing (x,y) coords + :param screenRelative: If set to true, the passed coords will be treated as absolute. (default=False) + """ if screenRelative: self.rect.x, self.rect.y = coords self.x = int((self.rect.x - self.mapOffset) / self.rect.w)