7
MIT App Inventor Lesson 4 – Drawing on a Canvas

MIT App Inventor

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

Page 1: MIT App Inventor

MIT App Inventor

Lesson 4 – Drawing on a Canvas

Page 2: MIT App Inventor

AgendaDrawing on a Canvas

◦Events Touched Dragged

Algorithms◦Increment / decrement

Page 3: MIT App Inventor

CanvasGrid for animation and graphicsUses (x,y) coordinates to locate

objects

(0,0)

(0,400)

(300,0)

(300,400)

Page 4: MIT App Inventor

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

Page 5: MIT App Inventor

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

Page 6: MIT App Inventor

Algorithms

Patterns

Increment◦Increase the value stored in a

variable

Decrement◦Decrease the value stored in a

variable

Page 7: MIT App Inventor

Lab 5 – Paint the Puppy

ObjectiveCreate an interactive drawing program.

◦Components Canvas

◦Concepts Responding to user input

Touched Dragged

◦Algorithms Increment / Decrement of variables