" Live as if you were to die tomorrow. Learn as if you were to live forever.. "
- Mahatma Gandhi

Get device screen width and height using Corona libraries

Posted on November 24th, 2015 by Raju Mahato

Every time we need device screen height and width to make proper UI. Application that are made using corona libraries, we can get height and width easily to that condition. Code Block : //Assign screen width local scrnWidth = display.stageWidth //Assign screen height local scrnHeight = display.stageHeight //Display the height and width in console print(scrnHeight, […]

Object Falling Throughout The Screen Randomly In LUA

Posted on November 23rd, 2015 by Raju Mahato

Some times in our applications, we need to show falling of objects randomly throughout the screen. So here is the code to do so. I have taken an approach to show rainfalls into the screen as an example. So code to be written in main.lua file is given below. Code Block : –Set the background […]

Moving An Object Tracing Finger Movement On Device Screen Using Lua

Posted on November 23rd, 2015 by Raju Mahato

Let’s say there is an object displayed on device screen and it moves along with your finger moving on the device screen. The way to do this using lua is explained below. Code Block : –Define a space to move the object throughout the screen local board = display.newRect( 0, 0, display.contentWidth, display.contentHeight ) board:setStrokeColor(255,255,255) […]

Move an object to left, right, up, down on button click using Lua

Posted on November 23rd, 2015 by Raju Mahato

In some instances we need to move our object to various direction as per the rule in game app. So here is some basic code to move an object to right, left, up and down. Code Block : –Make a box local box = display.newRect(200, 250, 100, 100) –Set the color of the box box:setFillColor(204, […]

Displaying Multiline Label In Crossplatform App Using Corona SDK

Posted on November 23rd, 2015 by Raju Mahato

Introduction : Label is genarally we used to display custom static messages to any application. Here we will see how can we display multiline message label to the screen. Description : Along with single line label, sometimes the label contents become too long which leads to show them in multiline. Corona sdk provides a simple […]

Passing Data From One Page To Another With Storyboard Using Corona

Posted on November 23rd, 2015 by Raju Mahato

Introduction : Its a very common practice, where we need to pass data from one page to another page. Corona provides storyboard API, which gives access to page navigation functionality, along with it can also pass data variable with in pages. Description : Lets make a scenario where we have home page and menu page […]

Function listeners in Corona

Posted on November 23rd, 2015 by Raju Mahato

Introduction : Listeners are generally used to do some job against any event associated with an object. There are different ways to define listeners. OnĀ  below I will describe about one of them. Description : In corona, repective listeners are being called, when an event get triggered. Basically there are two different ways to define […]

Table listener in Corona

Posted on November 23rd, 2015 by Raju Mahato

Introduction : Table listener is the one of the way to define listener for any display object in corona. Description : To describe table listener, lets have a window with a rectangle box and will add table listener with that box to show message on console. CODE BLOCK : main.lua local myBox = display.newRect( 100, […]