官术网_书友最值得收藏!

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 we will be making is called Hello World. It is a traditional program that many people learn when starting a new programming language.

  1. Open your preferred text editor and type the following lines:
    textObject = display.newText( "Hello World!", 50, 40, native.systemFont, 36 )
    textObject:setTextColor( 255,255,255)
  2. Next, create a folder on your desktop called Hello World. Save the preceding text as a file named main.lua to the location of your project folder.
  3. Launch Corona. You will be greeted with the Corona SDKscreen. Click on Simulator and navigate to the Hello World folder you just created. You should see your main.lua file in this folder as shown in the following screenshot:
    Time for action – creating a Hello World application in two lines of code
  4. On Mac, click on the Open button. On Windows, select the main.lua file and click the Open button. You'll see your new program running in the Corona Simulator:
    Time for action – creating a Hello World application in two lines of code
主站蜘蛛池模板: 濮阳县| 财经| 扎赉特旗| 沭阳县| 深圳市| 门源| 北安市| 堆龙德庆县| 浪卡子县| 沂水县| 仁布县| 体育| 滦平县| 固安县| 和顺县| 龙岩市| 共和县| 木里| 滦平县| 稷山县| 瑞丽市| 修文县| 砀山县| 阜南县| 漳平市| 寿阳县| 福贡县| 霍山县| 肥西县| 达尔| 桂林市| 交口县| 城口县| 龙游县| 水城县| 阳原县| 蕲春县| 阿尔山市| 犍为县| 黔南| 乐安县|