-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFrame.py
More file actions
27 lines (23 loc) · 847 Bytes
/
Frame.py
File metadata and controls
27 lines (23 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class Frame:
def __init__(self,frameWidth,frameHeight):
self.leftBorder = 0
self.rightBorder = frameWidth
self.upBorder = 0
self.downBorder = frameHeight
self.frameWidth = frameWidth
self.frameHeight = frameHeight
def moveFrame(self,direction):
if direction == "right":
self.leftBorder += self.frameWidth
self.rightBorder += self.frameWidth
if direction == "down":
self.upBorder += self.frameHeight
self.downBorder += self.frameHeight
if direction == "beginColumn":
self.leftBorder = 0
self.rightBorder = self.frameWidth
if direction == "endColumn":
self.leftBorder = self.frameWidth * 10
self.rightBorder = self.frameWidth * 10
def show(self):
print("Left = " + str(self.leftBorder) + "\tRight = " + str(self.rightBorder) + "\tUp = " + str(self.upBorder) + "\tDown = " + str(self.downBorder))