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

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
主站蜘蛛池模板: 林口县| 松阳县| 清水河县| 循化| 泸西县| 盐亭县| 宿松县| 南京市| 凉山| 涟源市| 扎赉特旗| 和静县| 安塞县| 克什克腾旗| 井陉县| 社旗县| 曲靖市| 环江| 崇仁县| 哈巴河县| 通山县| 嘉鱼县| 龙州县| 保靖县| 南部县| 岑溪市| 宝兴县| 开化县| 鹿泉市| 波密县| 河西区| 上思县| 屏边| 贞丰县| 井冈山市| 天柱县| 马鞍山市| 额济纳旗| 祁门县| 嘉荫县| 拉萨市|