The Hello World tutorial is a great first step into developing for MultiTouch cells. In this tutorial, you will learn how to create a simple application that displays several squares on the screen. The squares can be manipulated with standard translate, rotate, and scale gestures.
We begin the application by including a header file that declares the standard Cornerstone application that we are using:
We then declare our main function which acts as the entry point for the application:
Next, we create an instance of our application and initialize it. The MultiWidgets::Application::init function parses any command line arguments, starts up the multi-touch tracker, and sets up the graphics system:
Now that we have an instance of the application, we create five squares that we place on the screen. The MultiWidgets library contains generic widgets that can be used to create MultiTouch applications. The core Widget class is a simple rectangle with an optional border. Here we also specify the size, location and color of each widget, so that they don't appear on top of each other. The widgets are added to the scene as children of the application main layer widget:
Finally, we are ready to run the application and finish the block making up the main function:
The full source code for the complete application is listed below: