Introduction to Canvas Component

Canvas -- a sub-panel of the screen
  • App or user can draw in it
  • App can animate objects within it

X,Y coordinate system

0-> width
0-> height

Canvas properties: Width, Height, BackgroundColor, PaintColor

Canvas functions: DrawCircle, DrawLine

Canvas events


        note that dragged is triggered many times as user drags finger across the screen

Demo: Show x,y coordinates in a label when you touch canvas

    Set the width of the canvas to "Fill parent"
    note that event parameters are found in My Blocks (don't grab from event)
    How to draw a circle in middle of canvas?