Skip to first unread message

Mike D'Amico

unread,
Dec 9, 2019, 1:21:43 AM12/9/19
to MIT App Inventor Forum
Hi,
Is there anyway to draw on a canvas using the click of a button?  Specifically I was hoping to start in the middle, then each time a particular button is clicked the line increments a specific length in a particular direction, then each time it's clicked it adds that length to look like the line is getting longer.  I just thought of this, but similar to drawing with a turtle/arrow in Python (I don't know much about Python, just that I did an activity once where the turtle/arrow drew a line in different directions each time you gave it a command.

Thanks for any help

Taifun

unread,
Dec 9, 2019, 9:49:49 AM12/9/19
to MIT App Inventor Forum
yes of course you can call the canvas methods in a buton click event

you might want to try something and if you get stuck, then post a screenshot of your relevant blocks

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  
How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the
 Top 5 Tips: How to learn  App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by  Taifun.         



Reply all
Reply to author
Forward
0 new messages