Mercurial > sypikslang
comparison gamelib/gamegui.py @ 262:6f96e28e6cfd pyweek final submission
Tweak text position
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sun, 13 May 2012 01:55:08 +0200 |
parents | c949ac17cfd9 |
children | d2d1d9ccb22d |
comparison
equal
deleted
inserted
replaced
261:2a658a2f5d3b | 262:6f96e28e6cfd |
---|---|
46 def on_click(self): | 46 def on_click(self): |
47 PopWindow.post() | 47 PopWindow.post() |
48 | 48 |
49 | 49 |
50 class ExitGameButton(PopWindowButton): | 50 class ExitGameButton(PopWindowButton): |
51 | |
52 HEIGHT = 72 | |
53 | |
51 def __init__(self): | 54 def __init__(self): |
52 super(ExitGameButton, self).__init__((WIDTH - 128, HEIGHT - 60), | 55 super(ExitGameButton, self).__init__((WIDTH - 128, HEIGHT - 60), |
53 'Exit') | 56 'Exit') |
54 | 57 |
55 | 58 |
56 class EndTurnButton(BigButton): | 59 class EndTurnButton(BigButton): |
57 | 60 |
61 HEIGHT = 72 | |
62 | |
58 def __init__(self, parent): | 63 def __init__(self, parent): |
59 super(EndTurnButton, self).__init__(((WIDTH - 128), 0), 'End Turn') | 64 super(EndTurnButton, self).__init__(((WIDTH - 128), 0), 'End Turn') |
60 self.parent = parent | 65 self.parent = parent |
61 | 66 |
62 def on_click(self): | 67 def on_click(self): |
63 self.parent.end_turn() | 68 self.parent.end_turn() |
64 | 69 |
65 | 70 |
66 class NextTurnButton(PopWindowButton): | 71 class NextTurnButton(PopWindowButton): |
72 | |
73 HEIGHT = 72 | |
74 | |
67 def __init__(self): | 75 def __init__(self): |
68 super(NextTurnButton, self).__init__(((WIDTH - 128), 0), 'Next Turn') | 76 super(NextTurnButton, self).__init__(((WIDTH - 128), 0), 'Next Turn') |
69 | 77 |
70 | 78 |
71 class AssignButton(PopWindowButton): | 79 class AssignButton(PopWindowButton): |
80 | |
81 HEIGHT = 72 | |
82 | |
72 def __init__(self, parent): | 83 def __init__(self, parent): |
73 super(AssignButton, self).__init__(((WIDTH - 128), 0), | 84 super(AssignButton, self).__init__(((WIDTH - 128), 0), |
74 'Assign Scheme') | 85 'Assign Scheme') |
75 self.parent = parent | 86 self.parent = parent |
76 | 87 |
78 self.parent.accept() | 89 self.parent.accept() |
79 super(AssignButton, self).on_click() | 90 super(AssignButton, self).on_click() |
80 | 91 |
81 | 92 |
82 class CancelButton(PopWindowButton): | 93 class CancelButton(PopWindowButton): |
94 | |
95 HEIGHT = 72 | |
96 | |
83 def __init__(self, parent): | 97 def __init__(self, parent): |
84 super(CancelButton, self).__init__(((WIDTH - 256), 0), | 98 super(CancelButton, self).__init__(((WIDTH - 256), 0), |
85 'Cancel Scheme') | 99 'Cancel Scheme') |
86 self.parent = parent | 100 self.parent = parent |
87 | 101 |
90 super(CancelButton, self).on_click() | 104 super(CancelButton, self).on_click() |
91 | 105 |
92 | 106 |
93 class ResetButton(BigButton): | 107 class ResetButton(BigButton): |
94 | 108 |
109 HEIGHT = 72 | |
110 | |
95 def __init__(self, parent, text='Clear calendars'): | 111 def __init__(self, parent, text='Clear calendars'): |
96 super(ResetButton, self).__init__((10, 0), text) | 112 super(ResetButton, self).__init__((10, 0), text) |
97 self.parent = parent | 113 self.parent = parent |
98 | 114 |
99 def on_click(self): | 115 def on_click(self): |
100 self.parent.do_reset() | 116 self.parent.do_reset() |
101 | 117 |
102 | 118 |
103 class SwitchWinButton(BigButton): | 119 class SwitchWinButton(BigButton): |
120 | |
121 HEIGHT = 72 | |
104 | 122 |
105 def __init__(self, pos, text, new_window): | 123 def __init__(self, pos, text, new_window): |
106 super(SwitchWinButton, self).__init__(pos, text) | 124 super(SwitchWinButton, self).__init__(pos, text) |
107 self.new_window = new_window | 125 self.new_window = new_window |
108 | 126 |