First of all, let’s have a look into the MVC architecture. As we know Model creates the bridge between the database and the Controller, whereas View manages the UI in associate with the Controller. So, the vital part is the Controller, which builds the passage between the Model and View, passing the data
to & fro. The Controller contains all the logical codes that need to be done, and rest Model & View just contains the code required to manipulate the data.
Let’s go with a small application for better understanding. So here is the basic requirement, we will be having some students info stored on the local sqlite database and our job is to retrive those students and list them on the list view.
Few months ago I was just making a prototype of a gaming app. After few days when it reaches a position where a user can check it, I have shown it to one of my friend. After looking to its every corner we found some flaws and also listed some points that I need to implement to make it more presentable. He asked me why I don’t add a countdown before jumping to the game directly. Then I realized, it’s not a bad idea. After that I have implemented that without wasting any time in second thought. I manage to display countdown like 3, 2, 1 and then the game begins. So today we will see how we can make our own custom countdown.
So let’s say we have a gaming board page where we will play the game but before starting we will add countdown like 3, 2, 1 and after that user can play the game. So for that lets make a translucent background where we will show our countdown number.
An application with multiple pages will definitely require transition while moving from one page to another. Different frameworks use different ways to do the page transition. Corona SDK is also providing ease ways to do the same stuff. One of them is using director class and another one is use of storyboard. So today we will how story board can be used to do the page transition in our cross-platform mobile application.
Before starting let’s make a scenario. We will have two pages named home and menu and we will apply transition on these two pages. Home and menu page will contain a message labels, on click of them we will apply the effect. And also we will have the main.lua file which is the landing page for corona SDK. So here is the code for main.lua file which is the starting page of our application.