We're finally getting into the visually appealing part of this chapter by starting to add in display objects using images. We don't have to refer to the terminal window for now. So let's focus on the simulator screen. We'll begin by creating a background image and some art assets.
First off, create a new project folder to your desktop and name it
Display Objects
.In the
Chapter 2 Resources
folder, copy theglassbg.png
andmoon.png
image files into yourDisplay Objects
project folder. You can download the project files accompanying this book from the Packt website.Launch your text editor and create a new
main.lua
file for your current project.Write out the following lines of code:
local background = display.newImage( "glassbg.png", true ) local image01 = display.newImage( "moon.png", 110, 30 ) local image02 = display.newImage( "moon.png" ) image02.x = 160; image02.y = 200 image03 = display.newImage( "moon.png" ) image03.x = 160; image03.y = 320 ...