Skip to content

Commit 1e770de

Browse files
committed
Move make_button to button class
1 parent d438865 commit 1e770de

File tree

5 files changed

+139
-325
lines changed

5 files changed

+139
-325
lines changed

Menus/kalipi.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
os.environ["SDL_MOUSEDEV"] = "/dev/input/touchscreen"
1111
os.environ["SDL_MOUSEDRV"] = "TSLIB"
1212

13-
#############################
14-
## Global display settings ##
13+
#####################################################
14+
## Global display settings ##
1515

1616

1717
# colors R G B
@@ -80,7 +80,14 @@
8080
## Screen layouts ##
8181
###########################
8282

83+
## Global display settings ##
84+
#####################################################
85+
86+
87+
#############################
88+
## Global Functions ##
8389

90+
# Create button
8491
class Button(object):
8592
text = ""
8693
xpo = ""
@@ -128,13 +135,6 @@ def draw(self):
128135
screen.canvas.blit(label,(self.xpo,self.ypo+7))
129136

130137

131-
## Global display settings ##
132-
#############################
133-
134-
135-
#############################
136-
## Global Functions ##
137-
138138
# Initialis the screen
139139
def screen():
140140
pygame.font.init()
@@ -155,7 +155,7 @@ def border(color):
155155
if color == tron_blu:
156156
pygame.draw.rect(screen.canvas, tron_blu, (0,0,screen_x-1,screen_y-1),8)
157157
pygame.draw.rect(screen.canvas, tron_whi, (2,2,screen_x-5,screen_y-5),2)
158-
if color == tron_ora:
158+
elif color == tron_ora:
159159
pygame.draw.rect(screen.canvas, tron_ora, (0,0,screen_x-1,screen_y-1),8)
160160
pygame.draw.rect(screen.canvas, tron_yel, (2,2,screen_x-5,screen_y-5),2)
161161
else:

0 commit comments

Comments
 (0)