What is an API and how to use it? (SOLVED)

My second post and second “weird” question.
I know what, theoretically, an API is.
However defold is my 3rd engine ( I am still trying xD )
I did not get what is an api reference what does it speak about?
How is different from the manual and why does it seem “difficult”
is it neceassary to understand it?
Thank you have a nice day <3

There are no weird questions so fire away!

API is an acronym for Application Programming Interface. It is what you program against to make something work and usually consists of functions and data types. In Defold, there are a large number of functions available that you can call to make things happen. You call go.delete() to make a game object go away, for instance. There are also Defold specific data types, like vmath.vector3. We also have something called messages that are a bit special, like "acquire_input_focus".

The API reference on the site is a condensed reference list. It just presents all the functions, data types and messages. Its purpose is to give you the technical details of a function, message or data type. Here is the entry for the function spine.get_go():

Reading this assumes that you know what spine skeleton animations are, how to address things in Defold and more. It’s helpful if you know your way around Defold and needs to check things like what arguments a function takes or returns. If you are a new user I am sure much of the API docs just looks like gibberish, but that is pretty normal. In time it will start to make sense.

The manuals try to explain things from a user’s perspective. They are intended as a way for a new user to get a grip on how things in Defold works without assuming too much prior knowledge. They are a bit technical though since they cover some of the inner workings of Defold.

For new users we recommend starting with a few tutorials. They are practical: build something concrete and they try to explain things on the way. After doing a few tutorials you may encounter questions about how something works, then you should be able to find the answer in the manuals and API docs.

Does it make sense?

9 Likes

Hello
so to get it better it is like a dictionnary with all technical word and their uses?
However i Often read that API is used to communicate with other software so im sure i got it wrong :confused: .
finally okey i will focus on tutorials.

Yes, sort of like a dictionary of the special words that Defold understands.

1 Like

thank you the last thing i got you i thought it like when it is explained in youtube : API is a mean of communication between your software and other one

Yes, some software (or service) expose public APIs that can be used to communicate from other software over the internet.

everything is clear thanks again

3 Likes