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 Freecorona 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.
requirements
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).
- luaglider.
- corona complete.
install one of these ides.
creating a simple app with luaglider
step 1
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:
step 2
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.
step 3
build and run: tap on the run icon (top left corner).
output:
Published at DZone with permission of Yogesh Jain. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments