Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 9. People, Places, and Things > Recipe: Using Acceleration to Move Onsc...

Recipe: Using Acceleration to Move Onscreen Objects

With a bit of clever programming, the iPhone’s onboard accelerometer can make objects “move” around the screen, responding in real time to the way the user tilts the phone. Recipe 9-10 builds an animated butterfly that users can slide across the screen. Figure 9-5 shows what the screen looks like as the application runs and the user interactively controls the butterfly’s location.

Figure 9-5. Recipe 9-10 enables you to slide this butterfly around the screen by tilting the iPhone up, down, and sideways.



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial