- Corona SDK Mobile Game Development:Beginner's Guide(Second Edition)
- Michelle M. Fernandez
- 220字
- 2021-07-23 19:37:13
Time for action – creating a Hello World application in two lines of code
Now that we have the simulator and text editors set up, let's start making our very first Corona program! The first program that we will make is called Hello World
. It is a traditional program that many people learn when starting a new programming language.
- Open your preferred text editor and type the following lines:
textObject = display.newText( "Hello World!", 160, 80, native.systemFont, 36 ) textObject: setFillColor ( 1, 1, 1 )
- Next, create a folder on your desktop called
Hello World
. Save the preceding text as a file namedmain.lua
to the location of your project folder. - Launch Corona. You will be greeted with the Corona SDK screen. Click on Open and navigate to the
Hello World
folder you just created. You should see yourmain.lua
file in this folder: - On a Mac, click on the Open button. On Windows, select the
main.lua
file and click on the Open button. You'll see your new program running in the Corona simulator:
Tip
Downloading the example code
You can download the example code files for all Packt Publishing books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
推薦閱讀
- Spring Boot 2實(shí)戰(zhàn)之旅
- Data Visualization with D3 4.x Cookbook(Second Edition)
- C語(yǔ)言程序設(shè)計(jì)案例教程
- C語(yǔ)言程序設(shè)計(jì)教程
- Mastering ServiceStack
- 人人都是網(wǎng)站分析師:從分析師的視角理解網(wǎng)站和解讀數(shù)據(jù)
- 軟件工程
- Oracle Exadata專家手冊(cè)
- 深入淺出PostgreSQL
- 單片機(jī)應(yīng)用與調(diào)試項(xiàng)目教程(C語(yǔ)言版)
- Protocol-Oriented Programming with Swift
- ArcGIS for Desktop Cookbook
- Getting Started with Python and Raspberry Pi
- 單片機(jī)原理及應(yīng)用技術(shù)
- 算法訓(xùn)練營(yíng):海量圖解+競(jìng)賽刷題(入門篇)