From f1a2c59a8dc37c782b66feae713ce6d784feb654 Mon Sep 17 00:00:00 2001 From: Alan Aguiar Date: Wed, 25 Dec 2013 16:50:18 +0000 Subject: fix label position --- 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) diff --git a/conozco.py b/conozco.py index c948ae9..55ee636 100755 --- a/conozco.py +++ b/conozco.py @@ -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 -- cgit v0.9.1