diff options
author | Alan Aguiar <alanjas@hotmail.com> | 2013-12-25 16:50:18 (GMT) |
---|---|---|
committer | Alan Aguiar <alanjas@hotmail.com> | 2013-12-25 16:50:18 (GMT) |
commit | f1a2c59a8dc37c782b66feae713ce6d784feb654 (patch) | |
tree | 318387d69047ced627d1e6f0bf31faff25d84ff6 | |
parent | 0256912aceded2ede674b533729294f8b25391f7 (diff) |
fix label position
-rwxr-xr-x | activity.py | 6 | ||||
-rwxr-xr-x | conozco.py | 10 |
2 files changed, 7 insertions, 9 deletions
diff --git a/activity.py b/activity.py index 43ea0c2..659ac1f 100755 --- a/activity.py +++ b/activity.py @@ -121,13 +121,7 @@ class Activity(activity.Activity): def _add_point(self, widget, label="", value="City"): - #data = (label, float(value)) - #if not data in self.chart_data: pos = self.labels_and_values.add_value(label, value) - print 'new pos', pos - - #self.chart_data.insert(pos, data) - #self._update_chart_data() def _add_coor(self, pos): path = self.labels_and_values.update_selected_value(pos) @@ -473,15 +473,19 @@ class Conozco(): def showName(self, text, pos, font, color=(0,0,0)): t = font.render(text, 1, color) - self.pantalla.blit(t, pos) + r = t.get_rect() + r.center = (pos[0], pos[1]-14) + self.pantalla.blit(t, r) def update_points(self, l): self.pantalla.blit(self.fondo, (shift_x, shift_y)) for p in l: name = p[0] pos = p[1] - self.pantalla.blit(self.simboloCiudad, pos) self.showName(name, pos, self.fuente9) + pos = (pos[0] - 8, pos[1] - 8) + self.pantalla.blit(self.simboloCiudad, pos) + def principal(self): """Este es el loop principal del juego""" @@ -502,7 +506,7 @@ class Conozco(): for event in pygame.event.get(): if event.type == pygame.MOUSEBUTTONDOWN: pos = event.pos - self.pantalla.blit(self.simboloCiudad, pos) + #self.pantalla.blit(self.simboloCiudad, pos) self.parent._add_coor(pos) print pos |