Exemplo n.º 1
0
 def center_on_screen(self):
     print('size;', self.size)
     self.position = Vec2(
         int((self.screen_resolution[0] - self.size[0]) / 2),
         int((self.screen_resolution[1] - self.size[1]) / 2)
         )
Exemplo n.º 2
0
 def removeFromAtlas(self):
     """ Deletes the atlas coordinates, called by the atlas after the
     Source got removed from the atlas """
     self.doesHaveAtlasPos = False
     self.atlasPos = Vec2(0)
Exemplo n.º 3
0
 def bottom_left(self):
     return Vec2(-self.aspect_ratio/2, -.5)
Exemplo n.º 4
0
 def bottom_right(self):
     return Vec2(self.aspect_ratio/2, -.5)
Exemplo n.º 5
0
 def top_right(self):
     return Vec2(self.aspect_ratio/2, .5)
Exemplo n.º 6
0
 def top_left(self):
     return Vec2(-self.aspect_ratio/2, .5)
Exemplo n.º 7
0
 def right(self):
     return Vec2(self.aspect_ratio/2, 0)
Exemplo n.º 8
0
 def left(self):
     return Vec2(-self.aspect_ratio/2, 0)
Exemplo n.º 9
0
 def size(self):
     return Vec2(self.get_size()[0], self.get_size()[1])