O'Reilly logo

Creating Mobile Apps with Appcelerator Titanium by Christian Brousseau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Polo window

Implementing a reverse approach to the Marco Polo concept, we will first give our players the ability to provide information about their position to other players using the cloud. This approach makes sense because there is a little chance of getting the other player's location if no one shares it first.

The user interface

We will edit our PoloWindow.js file and add the following code right after where we created our window. We will begin by adding a new label at the top:

self.add(Ti.UI.createLabel({
  top: 17,
  width: '80%',
  height: Ti.UI.SIZE,
  color: '#000',
  text: 'Enter your name'
}));

We will then create a text field that will require our players to enter their name. It will span 80 percent of the screen's width, having a solid border ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required