You are on page 1of 4

Index

libGDX..........................................................................................................................................1
ApplicationAdapter/ApplicationListener......................................................................................4
“Variables”...................................................................................................................................5
Texture.....................................................................................................................................5
SpriteBatch...............................................................................................................................5
TextureRegions........................................................................................................................5

libGDX

https://libgdx.com/dev/project-generation/
As

you can see, we have a core project, android


project and desktop project, where, as it can
be seen, there is the main code, since the
android and desktop projects are mainly
launchers for those “operative systems”, since
we will be able to run the game as a desktop
app or as an android app.
ApplicationAdapter/ApplicationListener

This class is extended by the class Game, which is extended by the class MainGame.
The create() method is the one that will create all the resources that we need, all the
images, etc… It won’t do that on his own, we will have to call it.
The render() method is the one that will update our game status. So basically, it will
execute itself over 30 to 60 times per second and render everything that we have
loaded to the game. It is much more efficient to draw all the textures at once rather
than rendering them one by one.
The dispose() method will basically free the memory that was used by anything that
we are no using any more, for example images or sounds.
“Variables”

Texture
The textures basically are the images that you will load into your game.

SpriteBatch
It’s basically a class where you put all the textures in and load them all
together.

TextureRegions
This is basically what you use if you want to only take a region of
a texture. This may be useful when you want to draw a picture
but it’s not properly cut, like the example. You may do that in
that way, because for the libGDX or anything running the OpenGL
interface, it is way easier to load pixels which are a power of two.
(2n).

https://web.microsoftstream.com/video/86b63ef6-1e68-4631-a101-9ef736e953e0

You might also like