Draw custom shape and add color

Hello,
I am new to App Inventor. I am trying to create a Bluetooth app for android. The idea is that using HC-05, I'll send some RGB data to the app, and then using that data I'll change the color of some object. In this context, object means custom 2D shape. I am able to send the data to the app but I could not find a way to create a custom 2D shape in the platform. My idea was to use vertexes to create multiple custom shapes. Is it possible to create custom 2D shapes in App Inventor? If not then any suggestion on how to do that?

Best Regards,
Ifthekhar

Welcome.

To do this with App Inventor, you need a Canvas and the information at Creating Animated Apps and Drawing and Animation components

Try this:

and adapt it to your needs.

Does this help?

Here are some resources to help you learn to use the AI2 tools. 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 look here http://kio4.com/appinventor/index.htm and here http://www.imagnity.com/tutorial-index/ for more tutorials.

Learn about components http://ai2.appinventor.mit.edu/reference/components/
and visit the Library http://appinventor.mit.edu/explore/library Help>Library on the MENU

1 Like

@SteveJG, Thank you very much for your reply. It looks like your suggested method will solve my issue. Can I also change the color of the triangle in the "fill" section of the "DrawShape" function? In that case, for example, if I am using a potentiometer to send the color of an object then is it also possible to map the 10-bit ADC data to hex value (single input) or 0 to 255 (RGB input) value with any function?

But, I guess I should follow your suggestion and look through the Manual and programming course before asking any questions :sweat_smile:

Best Regards,
Ifthekhar

Research Canvas.PaintColor
and makeColor

Yes. :slight_smile: that would help.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.