-
Notifications
You must be signed in to change notification settings - Fork 0
/
HelpMode.py
57 lines (50 loc) · 1.96 KB
/
HelpMode.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#################################################
# HelpMode.py
# Pop-up mode that describes buttons and features
#
# Your name: Jackie Yang Section: J
# Your andrew id: jaclyny
#
#################################################
# Animation Framework From:
# https://www.cs.cmu.edu/~112/notes/notes-animations-part2.html
# Modified cmu_112_graphics lines 298 and 299
from cmu_112_graphics import *
from tkinter import *
from Drawnimate import *
from WelcomeMode import *
from DrawMode import *
from FlipbookMode import *
from GameMode import *
from PlayMode import *
class HelpMode(Mode):
def redrawAll(mode, canvas):
scale = 9
canvas.create_text(mode.width / 2, mode.height / scale,
text = " Help Screen", font = 'Arial 40 bold',
justify = CENTER)
help = '''
Simply click and drag to draw.
Use the left and right arrow keys to switch between layers and
create more of them.
Press 'v' to toggle the current layer's visibility.
To animate, simply draw one frame per layer and press the
'Flipbook' button!
You can make also make a game from your drawings by pressing 'Game'!
-----------------Buttons--------------------
Undo: Undos last stroke on current layer
Clear: Erases all strokes on current layer
Clear All: Erases all strokes from all layers
Brush: To draw
Color: Choose brush color
Eraser: To erase
Size: Adjust brush size
'''
canvas.create_text(mode.width / 2, mode.height / 2,
text = help, font = 'Arial 30', justify = CENTER)
back = " Press 'c' to return to canvas!"
canvas.create_text(mode.width / 2, mode.height - mode.height / scale,
text = back, font = 'Arial 30', justify = CENTER)
def keyPressed(mode, event):
if event.key == 'c':
mode.app.setActiveMode(mode.app.drawMode)