-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.py
More file actions
23 lines (20 loc) · 709 Bytes
/
Copy pathButton.py
File metadata and controls
23 lines (20 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Button(object):
def __init__(self, displayText):
self.xPos = 0
self.yPos = 0
self.bWidth = 0
self.bHeight = 0
self.displayText = displayText
self.morseCode = ""
self.clickToggle = False
def size(self, newWidth, newHeight):
self.bWidth = newWidth
self.bHeight = newHeight
def move(self, newX, newY):
self.xPos = newX
self.yPos = newY
def display(self, bColor, tColor):
fill(bColor)
rect(self.xPos, self.yPos, self.bWidth, self.bHeight, 7)
fill(tColor)
text(self.displayText, self.xPos + (self.bWidth * .3), self.yPos + (self.bHeight * .75))