How to Develop an App Using the Corona Framework
This quick tutorial will show you how to make a basic mobile application with the Corona cross-platform mobile development kit.
Join the DZone community and get the full member experience.Join For Free
corona sdk is a software development kit that lets developers create graphic cross-platform apps (for ios and android) using lua on top of c++/opengl. corona makes it very easy to roll out cross-platform games and graphic-intensive apps. it even includes a physics engine.
here's a tutorial on how to develop a simple application using the corona framework. this is just the beginning. the sdk provides many advanced features as well using which you can create amazing and addictive apps and games.
download and install the corona sdk .
there are many ide’s for working with the corona sdk. some good ones are
- corona project manager (cpm).
- corona complete.
install one of these ides.
creating a simple app with luaglider
launch the luaglider window. tap on the new project icon (top left corner) and the window will look like this:
click next. give the project name, project location, and project folder. click finish and the window will look like this:
once you complete step 1, the project window should look like this:
corona applications may be configured through two optional lua files, which should be saved to the project folder along with the main.lua file:
- config.lua: handles global content scaling and alignment for multiple screens.
- build.settings: handles build options like the screen resolutions and the setting of info.plist values for ios and/or application permissions for android.
now, select main.lua and write these lines:
local textobject = display.newtext("hello corona !!", 0, 0, native.systemfont, 40) -- textobject.x = display.contentwidth / 2 textobject.y = display.contentwidth / 4 textobject:settextcolor(255,255,255)
conventions used in the above code:
local is used for creating local objects.
display.newtext is for inserting text along with font name and font size.
textobject.x is the distance from the left side.
textobject.y is the distance from the top.
build and run: tap on the run icon (top left corner).
Published at DZone with permission of Yogesh Jain. See the original article here.
Opinions expressed by DZone contributors are their own.