I have never used this engine or any multiple platform engine, So I am just curious If i wrote a code that changed the game screen when i clicked in a certain area on the game (on computer version) would I have to write something different to get this to work on an android version of the app? I have never used an engine really before so I am not sure about this. And where would a good place to learn libgdx be?

Things like screen size (small Android devices vs desktop monitors), input (finger touch vs. mouse and keyboard), data storage (class-path on desktop/Android vs not on HTML) and so forth will obviously need to be taken into consideration. With that said, most of your code should be application independent, as long as you are being smart about things.

(For example, instead of using absolute UI positions and sizes which won't work on multiple resolutions, you might use layouts and resizable content.)

But if you are new to programming and gamedev, then I would suggest learning by writing several games for a single platform (e.g. desktop) before you try writing a multi-platform game.

Thanks for the advice but im not that new to java or gamedev I have made a pc and android game before. And im not sure if your aware but libgdx supports multiple platforms so I wasnt sure if I was the one who had to do this porting or libgdx offered some help

I started gamedev with java2d, why? All tuts are about java2d. After that I tried myself at jogl, I soon realized that most of the tuts are deprecated, that's why I switched to lwjgl. With some help of the forum I got familiar with it, the community is absolutely noobfriendly Now I am using libgdx for android, it's really worth it. If you use libgdx u get access to some really beginnerfriendly functions. The filesystem/rendering is completely platform independent. Furthermore I enjoy box2d, the "physics engine" I wrote by my self wasn't that accurate.Lastly I don't like the android sdk that much, I prefere libgdx best regards

how did u learn libgdx? i really want to start using it but im not sure how. this wont be my first game, i haev coded my own android game and made a pc game using slick2d and another pc without an engine. so im not too much of a newb lol

Most of the time I google my errors, but there are a lot of deprecated, outdated, "you shouldn't programm like that", let them call "tutorials" out there. After I can't find any good solution I post it in the newbie-section -> There's always a good guy/woman(haven't recognised one jet but don't want to discriminate them), who likes to help me There's a leack of good up-to-date java tuts.1. That's my favorite: http://code.google.com/p/libgdx/wiki/SimpleApp2. Of course the api is quite helpfull: http://libgdx.badlogicgames.com/nightlies/docs/api/3. That's about box2d: http://www.iforce2d.net/b2dtut/forces (it's in C++ but you will get it)4. The java-gaming.org community best regards

quick question about libgdx cross-compilation, is there are blog post or wiki page which lists all the things one must think of when cross-compiling to another platform.

Like what classes are forbidden to use and how to use libraries and so on.

not that I know of, generally you really have only a few things to think about.IF you want to do direct opengl calls, I think it is best to use "Gdx.graphics.getGLCommon()" instead of "Gdx.graphics.getGL10()" for example - I THINK.

ehm... in applet you cannot use FileHandle.list() - for obvious reasons. However I made this mistake a couple of times, since I would have a folder and load everything in it...

I cant really think of anything else... the HTML 5 port has some more stuff you cannot use, like System.nanoTime(), but upon convert/compiling it will tell you when a line cannot be used.

As per the Javadocs, that method of OrthographicCamera is only applicable in a GLES 1.x environment. With GLES 2.0 you'd submit the camera matrices to your shader.

To ensure your app works across all platforms, try to stick to what libgdx provides. This includes things like file i/o (use Gdx.app.files), networking (Gdx.app.net) and so on. The reason is that Android, HTML5 and iOS do not support all classes in the JRE. That's why we provide replacements which are sometimes even a bit better than their JRE equivalents in terms of say memory consumption and GC friendliness.

In terms of OpenGL ES, you can chose between 1.x (fixed function) or 2.0 (shaders). The higher level classes like SpriteBatch, BitmapFont and so on are all agnostic about which version you use. If you only issue OpenGL ES commands via the GLCommon interface (Gdx.gl) and leave the rest to the higher level classes, you will not run into any issues. If you want more control, you'll have to special case your rendering depending on what's available on the system. The gdx-invaders example in the repo demonstrates this. It has one renderer for OpenGL ES 1.x and another one for 2.0. Again, this is only necessary if you want to get your hands dirty with low-level OpenGL ES yourself.

TL;DR: use what libgdx provides, stay away from JRE classes if you target HTML5.

Also if you go with Libgdx and want to convert to html5, there are certain things you can't do in html5This is as of no fault of libgdx, but of the google GWT, you can't use certain things for GWT. The most specific example is Reflection. Although its usually half decent to rewrite code to not use it.

If you use SpriteBatch and Stage for 2D rendering, you shouldn't need to call apply() or setUniformMatrix().

Uh oh... okey... I was using

Box2DDebugRenderer

, so giving

cam.combined

to

renderer.render(world, cam.combined);

was enough.

Thanks

more off-topic stuff: Having guys hanging out at #libgdx irc would be pretty cool, since I often have quick questions, but can't get an answer anywhere... And using a forum topic is sometimes too much. (And sometimes I want a really quick answer, instant message is often pretty good).

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org