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 by performing the following steps:
First off, create a new project folder on your desktop and name it
Display Objects
.In the
Chapter 2 Resources
folder, copy theglassbg.png
andmoon.png
image files and theconfig.lua
file into yourDisplay Objects
project folder.Launch your text editor and create a new
main.lua
file for your current project.Write out the following lines of code:
local centerX = display.contentCenterX local centerY = display.contentCenterY local background = display.newImage( "glassbg.png", centerX, centerY, true) local image01 = display.newImage( "moon.png", 160, 80 ) local image02 = display.newImage( "moon.png" ) image02.x = 160; image02.y = 200 image03...