60 likes | 182 Views
Chapter 2. Paint Pot. We will build the Paint Pot app in class. Notes regarding the screen/user interface: 7 buttons and a canvas The canvas has a picture (initially of a kitten) but we allow the user to replace that with a picture taken by the camera
E N D
Chapter 2. Paint Pot We will build the Paint Pot app in class. Notes regarding the screen/user interface: 7 buttons and a canvas The canvas has a picture (initially of a kitten) but we allow the user to replace that with a picture taken by the camera The user can draw lines by dragging a finger on the screen The user can make dots by touching the screen Buttons allow the user to select small or large dots The user can wipe the picture clean (remove dots and lines)
Chapter 2. Paint Pot App behaviour for 7 buttons Red button clicked - The colour used for drawing becomes red Green button clicked -The colour used for drawing becomes red Blue button clicked - The colour used for drawing becomes red Take Picture button clicked –The camera is used to take a picture Wipebutton clicked – all lines and dots are removed Big Dots button clicked – the size of dots is set to a large size Small Dots button clicked – the size of dots is set to a small size
Chapter 2. Paint Pot App behaviour for the canvas User touches the screen – a dot is drawn at that position User drags finger across screen –a line is drawn between the start and end positions
Chapter 2. Paint Pot What additional components are needed ? Camera – in order to take a picture Horizontal arrangements (x 2)
Chapter 2. Paint Pot Optional: David Wolber’syoutube videos http://www.youtube.com/watch?v=gHPae2B5pN0&feature=BFa&list=PLCF2969C390CE87F4
Chapter 2. Paint Pot Paint Pot demonstrates drawing on the canvas component calling procedures with arguments … the call statement a variable Giving it a name … dotSize Initializing the variable … def statement Assigning the variable a new value … set statement event handlers for button and screen events Button is clicked Canvas is touched Canvas is dragged Camera after picture is taken