The noobiest question ever. How do you understand the API library? I really don´t understand it.

What is are the “Libraries”? What are the “Events” for? And what is the “Type” all about?

So when i click on a library for exampel “audio.dispose()” it gives me:

Type

Library

Return value

I really dont understand how to use them in your code?

So i guess i need a guide for the whole API thing. I would be really really glad to get a guide on that.

Josh

Josh,

Do you have any experience programming?  If not, you should start off writing some Lua code and getting up to speed on that.  Then, you’ll want to get at least one book associated with Corona and read it end-to-end, meanwhile following the examples.

You can’t really just start making games if you don’t have a basis to work from.

Regardless, I strongly suggest the latter route.  Get one or more books and follow them.

http://www.burtonsmediagroup.com/books/mobile-app-development-with-corona-getting-started/

In Corona SDK, our various API calls are organized into libraries.  This is just away of grouping similar functions.  For instance:

facebook.login()

facebook.request()

facebook.logout()

Are all part of the facebook library.  From your perspective the library name is just the name of the library with the API call separated by a period.  There might be other libraries that functions of the same name, such as network.request().  By classifying them, we can have multiple “request” functions.

The “Type” entry tells you what type of items is being described.  Most of the time, this will be “function” meaning it calls code and returns a value.  Sometimes it will be “Number” or “String” meaning these are not runnable functions, but data values that your code can use.  For instance: display.contentWidth doesn’t run code and get a result, it simply is a value your code can use, in this case a number.

Return Value should only be there for things that are a Type of “function”.  Since function do work, they have to have a way to give that work back to you.  This happens in one of two ways, the value is “returned” by the function:

local someNumber = tonumber( “10” )

In this case the function “tonumber” takes in a string that happens to have the letters 1 and 0 in it and returns an actual number 10.  If the function returns a value, the “Return Value” will tell you what’s being returned.  It could be “String”, “Number”, “Function”, “Table”, “Boolean”, “Userdata”.  This lets you know what to expect to get back.  Lua allows the function to return multiple things, so if you see our documentation saying: 

Return Value:   boolean, string

Then that function returns a true/false value and a string value.

Some functions don’t return anything like this.  Usually because they can take too long to do the work requested.  The network.request() is an example of this.  Since we have no ideal how long it will take the web server to respond to the request, we don’t want to hold up your app from continuing to do things.  These functions will have a “listener” function, some times referred to as a “call back function”.  When the request completes, your code will be notified that the task is done by calling the function you passed in the “handle” the result.

But @rominggammer is right, start with some tutorials, look at some sample code.  Dr. Burton’s book is a great starting point.

Rob

Hi again.  Hopefully I didn’t come off as a downer or being mean, but based on the questions you were asking, it seems like you might be new to programming.  If so, you would be best served by a structured start, then you can turn the creative dogs loose.   If you start off without building a foundation you may soon find yourself frustrated and I certainly don’t want to see that.  

Cheers and best of luck on your adventure.

Hey, I think that´s my major problem. It´s the knowledge. I am new to Corona but i really really want to program. But you know i have a project so far and it´s going pretty okay. But most of my time i have to look up things because i don´t know how to do them. And therefor the whole process goes very slow. But my main problem is that this project is a school project. I took this risk because i really really want to learn how to progam. I didn´t want to waste time on this big final exam project on searching things like “Why does a frog make sounds.” because i consider that as waste of time of my life. So i guess i really really need to work hard to achieve my goal. If i don´t i will not be able to go college since i am in high school now. 

So I found this pdf file which was free. I found it here. http://it-ebooks.info/book/2388/

Could you please tell me if that book is a good start for me? 

Hello again.

  1. I can’t really give an opinion of that book.  I’ve never read it.  However, can give you my opinion on Dr. Burton’s work.  I think you’d be better served by his very up-to-date books.

  2. If you are new to programming and don’t take the time to lay a foundation by learning the basics, you’re really short-changing yourself.  Additionally, you will, in all likelyhood, form bad habits and through lack of knowledge, choose to do things the wrong way.

Being a self-starter is great, but there is a reason why people start at the bottom when learning complex topic.

Yeah I understand. I was learing languages from Codecademy but since Lua doesnt excist there I really don´t know how to build up my knowledge. So i guess i´ll read the book you recomended me. But if i ask. Why do you recomend it to me?

I did a quick scan on the book and it’s using an older version of Corona SDK.  Many things have changed since that book came out and I believe it’s old enough to be using the Graphics 1.0 engine.  So the Lua parts will be good.  Most of the Corona parts will be good, though positioning things will be different. 

You might be better off with a more modern book.

Rob

Okay is it possible to get the book roaminggamer recommended for free? Because I am a poor student and this is what i dream for. This is what i want to do for the rest of my life. 

There are plenty of free resources to lean from, but most book resources are going to cost something.

Rob

Josh,

Do you have any experience programming?  If not, you should start off writing some Lua code and getting up to speed on that.  Then, you’ll want to get at least one book associated with Corona and read it end-to-end, meanwhile following the examples.

You can’t really just start making games if you don’t have a basis to work from.

Regardless, I strongly suggest the latter route.  Get one or more books and follow them.

http://www.burtonsmediagroup.com/books/mobile-app-development-with-corona-getting-started/

In Corona SDK, our various API calls are organized into libraries.  This is just away of grouping similar functions.  For instance:

facebook.login()

facebook.request()

facebook.logout()

Are all part of the facebook library.  From your perspective the library name is just the name of the library with the API call separated by a period.  There might be other libraries that functions of the same name, such as network.request().  By classifying them, we can have multiple “request” functions.

The “Type” entry tells you what type of items is being described.  Most of the time, this will be “function” meaning it calls code and returns a value.  Sometimes it will be “Number” or “String” meaning these are not runnable functions, but data values that your code can use.  For instance: display.contentWidth doesn’t run code and get a result, it simply is a value your code can use, in this case a number.

Return Value should only be there for things that are a Type of “function”.  Since function do work, they have to have a way to give that work back to you.  This happens in one of two ways, the value is “returned” by the function:

local someNumber = tonumber( “10” )

In this case the function “tonumber” takes in a string that happens to have the letters 1 and 0 in it and returns an actual number 10.  If the function returns a value, the “Return Value” will tell you what’s being returned.  It could be “String”, “Number”, “Function”, “Table”, “Boolean”, “Userdata”.  This lets you know what to expect to get back.  Lua allows the function to return multiple things, so if you see our documentation saying: 

Return Value:   boolean, string

Then that function returns a true/false value and a string value.

Some functions don’t return anything like this.  Usually because they can take too long to do the work requested.  The network.request() is an example of this.  Since we have no ideal how long it will take the web server to respond to the request, we don’t want to hold up your app from continuing to do things.  These functions will have a “listener” function, some times referred to as a “call back function”.  When the request completes, your code will be notified that the task is done by calling the function you passed in the “handle” the result.

But @rominggammer is right, start with some tutorials, look at some sample code.  Dr. Burton’s book is a great starting point.

Rob

Hi again.  Hopefully I didn’t come off as a downer or being mean, but based on the questions you were asking, it seems like you might be new to programming.  If so, you would be best served by a structured start, then you can turn the creative dogs loose.   If you start off without building a foundation you may soon find yourself frustrated and I certainly don’t want to see that.  

Cheers and best of luck on your adventure.

Hey, I think that´s my major problem. It´s the knowledge. I am new to Corona but i really really want to program. But you know i have a project so far and it´s going pretty okay. But most of my time i have to look up things because i don´t know how to do them. And therefor the whole process goes very slow. But my main problem is that this project is a school project. I took this risk because i really really want to learn how to progam. I didn´t want to waste time on this big final exam project on searching things like “Why does a frog make sounds.” because i consider that as waste of time of my life. So i guess i really really need to work hard to achieve my goal. If i don´t i will not be able to go college since i am in high school now. 

So I found this pdf file which was free. I found it here. http://it-ebooks.info/book/2388/

Could you please tell me if that book is a good start for me? 

Hello again.

  1. I can’t really give an opinion of that book.  I’ve never read it.  However, can give you my opinion on Dr. Burton’s work.  I think you’d be better served by his very up-to-date books.

  2. If you are new to programming and don’t take the time to lay a foundation by learning the basics, you’re really short-changing yourself.  Additionally, you will, in all likelyhood, form bad habits and through lack of knowledge, choose to do things the wrong way.

Being a self-starter is great, but there is a reason why people start at the bottom when learning complex topic.

Yeah I understand. I was learing languages from Codecademy but since Lua doesnt excist there I really don´t know how to build up my knowledge. So i guess i´ll read the book you recomended me. But if i ask. Why do you recomend it to me?

I did a quick scan on the book and it’s using an older version of Corona SDK.  Many things have changed since that book came out and I believe it’s old enough to be using the Graphics 1.0 engine.  So the Lua parts will be good.  Most of the Corona parts will be good, though positioning things will be different. 

You might be better off with a more modern book.

Rob

Okay is it possible to get the book roaminggamer recommended for free? Because I am a poor student and this is what i dream for. This is what i want to do for the rest of my life. 

There are plenty of free resources to lean from, but most book resources are going to cost something.

Rob