Tag Archives: buttons

Can App Inventor have a button or control that rotates on screen?

A reader asked: Is there is a way to have a control, such as a button, rotate on the screen?

With a simple trick, the answer is Yes!

The trick is to use ImageSprites that are made to look like buttons. Then, instead of .Click event handler, as used on a Button, we use one of the “touch” events defined for the ImageSprite class. To rotate the sprite, change the sprite’s Heading property. Easy!

If you would like to learn more about ImageSprites, please read my online tutorial “Using ImageSprites for animated App Inventor Graphics”.

I’ve also written an inexpensive 227 page e-book all about graphics, animation and charts available from many online e-book outlets. You may find that text helpful to you as well.

Tutorial Video

The tutorial is shown here as a video – or page down for a written version of the tutorial.

User View

Watch this video to see what a rotating button looks like:

Designer View

Creating the user interface is the same as creating other App Inventor user interfaces – except we use a graphical drawing area called the Canvas and add an ImageSprite to the Canvas.

Continue reading Can App Inventor have a button or control that rotates on screen?

How to change button colors in App Inventor

You can change the colors of buttons (and some other components) in your App Inventor apps. Using some programming tricks, buttons can be made to change color continuously!

Here is a very short demo of a button whose color is continuously changing on the screen:

I will soon post a tutorial on how to do simple color changes and also how to do “tricks” like that shown in this video.

Be sure to keep checking back, like us on Facebook, Google+ and Twitter for more updates! Thanks!