close

Quick Start Guide

 

You only need two things to get started with Corona:

  1. A copy of Corona
  2. Any text editor

Many people already have a favorite text editor, but if you don't, we recommend starting with TextWrangler, which is free and can be downloaded here.

You could also use the TextEdit utility that's included with your Mac, but you'll find that it's easier to work with a text editor designed for programming, so try TextWrangler if you don't have a personal favorite.

Later on, you'll need to install Apple's developer kit to test on your iPhone or iPad, or ship your app to the App Store, but you can get started with Corona in the meantime.

你只需要兩樣東西要開始使用電暈

副本電暈
任何文本編輯器
許多人已經有一個喜歡的文本編輯器,但如果你不這樣做,我們建議開始TextWrangler,這是免費的,可以在這裡下載。

你也可以使用文本編輯工具,產品內容你的Mac,但你會發現它更容易使用一個文本編輯器進行編程設計的,所以盡量 TextWrangler,如果你不有個人的最愛。

後來,你需要安裝蘋果開發工具包來測試你的iPhone或ipad,或將您的應用程序應用程序商店,但你可以開始使用電暈其間。

Your First Corona Program

Corona ships with code samples that demonstrate certain game features. In addition, there is a separate library of samples to illustrate more basic Corona features, including examples for accessing the camera, GPS, accelerometer, compass, and so on. 

If you're just getting started with Corona, you'll probably want this sample library, which can be downloaded here:

Click to download (.zip, 18 MB)

Within this archive, the samples are divided into several categories, organized by folder. In the "GettingStarted" folder, you'll find a project called "HelloWorld".

A "Hello World" program is a traditional way to begin any new programming language. In our Corona example above, we try to make it a bit more interesting by adding some graphics. But to keep things simple, let's start with the most basic version.

你的第一個電暈計劃 

電暈附帶的代碼示例演示某些遊戲功能。此外,還有一個單獨的庫來說明樣本更基本的電暈特性,其中包括範例訪問攝像頭,GPS,加速度計,指南針等。 

如果你剛開始使用電暈,你可能想要這個樣本庫,它可以在這裡下載: 

點擊下載(。zip文件,18 MB的) 

在這個檔案庫,樣本分為幾個類別,按文件夾組織。在“GettingStarted”文件夾,你會發現一個名為的“HelloWorld”。 

一個“Hello World”程序是一種傳統的方式開始任何新的編程語言。在我們的電暈上述例子中,我們盡量做到多一點,加入一些有趣的圖形。但是為了簡單起見,讓我們先從最基本的版本。 

 

Open TextWrangler (or your favorite editor) and type the following lines:

打開 TextWrangler(或你喜歡的編輯器),然後鍵入以下行: 

myText = display.newText( "Hello, World!", 20, 40, native.systemFont, 36 )
myText:setTextColor( 255,0,0 )

Next, create a folder named "Hello World", and save the above text as a file named "main.lua".

Now start Corona. On Mac OS X, locate the Corona folder in your Applications directory. Double-click on "Corona Simulator". On Microsoft Windows, select Corona from the list of Programs in your Start menu.

接下來,創建一個文件夾名為“你好世界”,並保存上面的文本作為一個文件名為“main.lua”。 


現在開始電暈。在Mac OS X中,找到你的應用程序文件夾中電暈目錄。雙擊“電暈模擬器”。在Microsoft Windows中,選擇從列表電暈程序在開始菜單​​。 

 

When Corona opens, you'll be greeted with a welcome screen:
電暈打開,你會看到一個歡迎屏幕

Click the first item: "Open a Project".

Finally, navigate to the "Hello World" folder you just created. You should see your "main.lua" file in this folder. 

單擊第一個項目:“打開項目

最後,導航到你好世界“剛創建的文件夾您應該看到您的“main.lua“文件夾內。

 

Now click the "Open" button, and you'll see your new program running in the Corona Simulator:

現在點擊“打開“按鈕,你會看到新的程序運行日冕中的模擬器:

 

Believe it or not, this two-line program is a complete iPhone application. Better yet, it's also a complete iPad or Android application! 

Using Corona, you could ship this app to either the iTunes App Store or the Android Marketplace. In real life, you would obviously want your app to do more than print some text, but you've now seen the basic Corona workflow.

信不信由你,這兩個行程序是一個完整的iPhone應用程序。更好的是,它也是一個完整的iPad或Android應用程序

利用電暈,你可以這個應用程序或者船舶的iTunes App Store或Android的市場在現實生活中,你明顯地希望您的應用程序做的多打印一些文本,但你現在看到日冕的基本工作流程。

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 createps 的頭像
    createps

    遊戲人生 人生遊戲

    createps 發表在 痞客邦 留言(0) 人氣()