[MUSIC]
Well Good day. Good day.
It's Tim Buchalka here again.
The Ozzy android dev guy.
And in today's video we're going to go ahead and set up libGDX for the Mac.
Now in case you don't know libGDX is a framework for creating games.
Fantastic Framework.
It's free to use.
And look, it's really, really worthwhile.
It's written in Java, but it also supports other platforms, but
this video is gonna focus on configuring that for Android Studio on a MAC.
Now, if you're running Windows or running Linux, click on one of
the videos over here, to my left, and I've got a video just for you, covering that.
But now, let's get stuck into configuring and installing the library.
For Android Studio on a Mac.
Okay, we're gonna search for Libgdx, and I could have just gone
to libgdx.badlogicgames.com instead, I'm gonna click on that and go to download.
Click on Download Setup App That's only a small file, so it won't take long.
So we're gonna click into there.
And now, I just need to double click it.
And if you're gonna get this message up
saying it cannot be opened because it's from an unidentified developer,
that's because of the security preferences you've set up in System Preferences.
You can easily overcome that.
Just okay that.
Go into System Preferences.
Go into Security and Privacy.
And you can see down here because it's the last we've opened we could either go
through and click the lock to make the changes and then choose Anywhere.
Or we could just click on Open Anyway,
which sort of lets this application open once.
So we're just gonna do that in this case.
The server's having to change any other preferences.
Open Anyway.
Then we'll close down preferences and I'm just gonna click on Open now.
And that's gonna invite Java and
then run this application so that we can set up our project.
So this is how we go about setting up a new libGDX project for the first time.
Now there's a couple of things we'll need to know.
We need to know the destination, where we want to store our Files,
this is to store the project that it creates and also the Android SDK.
So the easiest way to find both of those is to go into Android Studio.
So I'm going to hold down command and press space and type: Android.
Or I typed 'A,' actually, and that was enough.
Starting Android Studio All right if
you probably recall this from a previous video we've been doing control, sorry.
Config, project defaults, and then project structure and
that's the location of our Android SDK.
So I'm just going to copy that.
Cancel.
Taken a copy and I'm just going to tab back over to it.
That's going to be our Android location.
I could have just browsed to it as well, but
I find it's easier just to paste the location.
Now the location is where we want to save the files.
This is the project files.
So you probably, when you set up Android Studio,
what you should have is a folder somewhere Where you store all your projects.
Okay, going back into Android Studio,
we haven't got a project yet, but we can go back.
We can create a new one.
And you see the project location here is where it's going to put it in.
So it's going to be putting them in that.
Okay, so I'm gonna select.
That component,
not the actual name of the app but everything other than that, copy that.
Again, Cancel out of that.
Alt+Tab back to there again and I'm gonna paste in the destination.
But I'm also gonna put in the name of the project.
I'm just gonna call it test in this case.
So the other things we need to know is the name.
Obviously it's gonna be a test but
you'd put in what the real name of your project was.
We're gonna call it test game.
Package again is normally the name of your domain in reverse notation.
So if your normal domain is TimBuchalka.com What'd
you'd enter here is com.
And by convention, it's normally the name of the game, so .testgame.
That needs to be a unique identifier across all of Google Play.
So the way to do that,
because it's your own domain, It's much easier to do it that way.
And there's other ways of creating packages that are outside of the scope of
this view.
I'll look to address that in an additional video.
For now you just need to put something in there.
And game class is going to be the main game class
that contains the code to start the game.
Lets call it startgxgame.
Okay, so that's pretty well everything we need up to that point.
The lib, the version, that's usually only the latest release anyway,
release 1.5.4 has only just come out as I'm recording this video.
Now Sub projects, libGDX works on other platforms, so
we can specify other platforms.
HTML, iOS, or desktop.
I'm only gonna select Android here but you could do that if you wanted to.
Now there's also some optional extensions that you can download and
some of these are really pretty cool.
I mean if you wanted to you could just literally select everything.
In my case I'm going to select, well I'm gonna go through and
tell you what they are.
Bullet is a physics offering.
Freetop is a way for you have a lot of white fonts.
[INAUDIBLE] has got things like texture packers and bitmap font generators and
those types of things.
Controller is for game pads and joy sticks.
Box 2D is a 2D graphics, physics library, I should say.
The box 2D lights enables functionality for lights and shadows in 2D.
Ashley is an entity framework and AI is artificial intelligence which is a lobby
that's built into or part of [INAUDIBLE] as an extension to libGDX.
And also, show third party extensions if you want to.
There's another one there called overlap which again is a level on UI Editor so
this will change over time as well so A great thing about this is there's lots of
different packages there that are reliable so you can select any one that you want
to, any or all of them, and they'll be included in the project we're creating.
Advanced you don't really need to go into, but I'll just show you that now.
That's if you wanted to create an Eclipse project or an ID project or
an offline mode.
We don't want to do any of that because we don't need to we're using Android Studio.
We cancel out of that.
Next option now is just to click on generate.
This may come up with a warning and
that's because we installed the very latest version.
We're going to click on yes use it anyway.
If there was a problem you could always go back into SDK manager.
Which again you can reference that from Android Studio and
download a previous version.
But in general the way that the tools are it's okay to use the latest version.
Click on yes.
You can see down at the bottom of the screen now,
it's coming up with a message and it's generating.
It tends to take awhile to finish because it actually has to download the files.
So the initial download was really only a setup program that enabled you to
type in those parameters and then choose what options you wanted for the project.
It now needs to download the physical bits and pieces.
That form part of this entire project so
that we can then open it up an Android studio.
It's gonna pull this video till this is done.
Okay, you can see we're done there, down at the bottom left hand corner we're done.
Took about a minute to actually finish up the completion.
So at this point we're actually done, we can close this.
We can shoot over into Android Studio again now.
So, what we can do, the quickest way is just to Import Non-Android Studio project.
So click on that.
Good thing about that is that'll import the project into Android Studio,
but also keep it in the same In folder.
So we now need to navigate to the folder
where the libGDX setup corrected the project.
As you recall, that was in android studios and we had a folder called test.
So I'm just going to click on test there and
click on okay, If you do get a message like that,
just click on OK and Android Studio will nicely update things for you.
Again, it has to fiddle around and
go through the project and figure out the dependencies and so forth.
So, that may take a couple of minutes, depending on.
Speed of your computer and
also the download speed because it is downloading a few extra files.
So I'm just gonna pause until we get to the next step.
Okay, so we're still chugging away in the bottom right-hand corner.
It's processing away, just setting up the project.
Once that finishes we'll just have a quick look at what it's created.
Or to be more technically correct, it hasn't corrected anything.
It's opening this project and just really creating a structure around it so
that it works within Android Studio.
And from this point on once we've imported this project for the first time you can
open and close this project as you would any normal Android Studio project.
It does take a few minutes to finish this and it will take that the first time.
But again once it's all imported into Android Studio you'll find it'll be much
faster and more responsive subsequent times when you're opening the project.
Okay can see there that we're done.
So if we close that tip of the day We can now go into the Android project.
So we can go into the Android project now, we can have a look at the manifests.
Standard manifests file.
You can see it's automatically put the various bits and
pieces that we chose, obviously the test game.
But it's also
lthepackage.android.androidlauncher as well.
Cause of course it was cross platform.
And it's the java code there.
Just the basics to get you up and running.
But that's actually a project there in its own right.
And under core.
Under core components of GDX.
That's the start.
You can see that by default this basic project will actually run and
show the bad logic JPEG on the screen.
It's also some great oh scripts that are now part of the original created project.
Project.
And you can see they've got listing various repositories and so forth, and
various natives and so forth, that are all particular to this platform.
So that's it.
That's setting up LibGDX on Android Studio.
And we're done.
Dusted, complete, and fully set up.
So LibGDX is now ready to go on your machine.
Please now subscribe to my channel click on, the subscribe button to the left hand
side and you'll be kept up to date with new videos as I release them.
You got a moment can I have to check out my Android development course?
Over 25 hours of video training showing you how to become a better
Android developer.
Feel free also to peruse some of the videos to my left hand side.
And really get your fill, so to speak, of more Android app goodness.
Last, but my no means least, please comment on this video.
Let me know what you thought about it.
But also, please give me some feedback on what you'd like me to cover in
a future video, and I'll aim to do just that, to cover as many of those requests.
If I can't in future videos.
This is Temper Cherka the Ozzy Android dev course sounding off and
I'll see you in another video.
Cheers for now