Game Development Reference
In-Depth Information
Hello World on the Device
The display namespace has functions to create basic display objects, including images, text,
rectangles, rounded rectangles, circles, lines, groups, and so forth. To begin, we'll create a text
object and display it on the screen.
local lblText = display.newText("Hello World",10,50)
This one line will place a new text object with the text Hello World on the screen at locations 10 and 50
in the default system font as can be seen in Figure 8-4 . The syntax of the function newText is as follows:
display.newText( [parentGroup,] string, left, top, font, size )
display.newText( [parentGroup,] string, left, top, [width, height,] font, size )
Figure 8-4. “Hello World” displayed as a label on the device
At any point, you can build the application for the device and run it on the device rather than running
it in the simulator. To be able to upload a built app onto an iOS device, you will need to be enrolled
in Apple's iOS Developer Program and have the necessary certificate to sign the app to be able to
upload to the device. On Android, this should not be an issue, and you can build an APK that can be
uploaded to the Android device.
 
Search WWH ::




Custom Search