diff --git a/main.py b/main.py index b2a9139..4f66fca 100644 --- a/main.py +++ b/main.py @@ -48,7 +48,9 @@ class StrategyGame(FloatLayout): Color(1, 1, 1, 1) hex_cell.coord_label = Label( - text=hex_cell.coordinate_text(), center_x=hex_cell.x, center_y=hex_cell.y) + text=hex_cell.map_display_text(), + center_x=hex_cell.x, + center_y=hex_cell.y) # Bind the cell code so as to update its position and size when the parent widget resizes. hex_cell.bind(pos=hex_cell.update_pos, size=hex_cell.update_pos) @@ -62,6 +64,12 @@ class HexMapCell(Label): def coordinate_text(self): return '({}, {})'.format(self.coords.row, self.coords.col) + def map_coordinate_text(self): + return '[{}, {}]'.format(self.coords.row / 3, self.coords.col / 2) + + def map_display_text(self): + return "{}\n{}".format(self.coordinate_text(), self.map_coordinate_text()) + def update_pos(self, instance, value): # Determine the location of the solid hexagon cell. Needs to be offset from the centre of the hex. radius = 2 * self.height