Upload
macey-ramsey
View
43
Download
0
Embed Size (px)
DESCRIPTION
MIT App Inventor. Lesson 4 – Drawing on a Canvas. Agenda. Drawing on a Canvas Events Touched Dragged Algorithms Increment / decrement. Canvas. Grid for animation and graphics Uses (x,y) coordinates to locate objects. (0,0). (300,0). (0,400). (300,400). Canvas components. - PowerPoint PPT Presentation
Citation preview
MIT App Inventor
Lesson 4 – Drawing on a Canvas
AgendaDrawing on a Canvas
◦Events Touched Dragged
Algorithms◦Increment / decrement
CanvasGrid for animation and graphicsUses (x,y) coordinates to locate
objects
(0,0)
(0,400)
(300,0)
(300,400)
Canvas components
coordinates provided to event handlerIn this case the action is to Draw a Circle
on the same canvas◦ can have multiple canvas objects
Controlling ObjectsA separate canvas and sprite can be
used as a game controller.The value of draggedSprite is True
when the sprite is being dragged
Algorithms
Patterns
Increment◦Increase the value stored in a
variable
Decrement◦Decrease the value stored in a
variable
Lab 5 – Paint the Puppy
ObjectiveCreate an interactive drawing program.
◦Components Canvas
◦Concepts Responding to user input
Touched Dragged
◦Algorithms Increment / Decrement of variables