Chapter 7. Creating Animations, Transformations, and Understanding Drag-and-drop

In this chapter, we will cover:

  • Animating a View using the "animate" method
  • Animating a View using 2D matrix and 3D matrix transforms
  • Dragging an ImageView using touch events
  • Scaling an ImageView using a Slider control
  • Saving our "Funny Face" image using the toImage() method

Introduction

Almost any control or element in Titanium can have an animation or transform applied to it. This allows you to enhance your applications by adding a level of interactivity and "bling" that your apps would otherwise perhaps not have.

In this chapter, we are going to create a small application that allows the user to choose a "funny face" image, which we are going to position over the top of a photograph of ourselves. We'll use transitions and animations in order to display the funny face pictures and allow the user to adjust the size of his/her photograph and its position so that it fits neatly within the funny-face cutout section.

Finally, we'll combine both our "me" photograph and the funny face into one complete image using the Windows toImage() method, letting the user e-mail the resulting image to his/her friends!

Note

Complete source code for this entire chapter can be found in the Chapter 7/FunnyFaces folder.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.166.31