libgdx

LibGDX - How to integrate AdMob for both iOS and Android

半世苍凉 提交于 2019-12-18 13:26:54
问题 I am following this tutorial for AdMob integration through LibGDX, but it shows for Android only. I am just wondering if someone has an example how to achieve same integration including iOS? Also, how can I use banners instead of full screen? Currently my setting for iOS with LibGDX is: 1.- RoboVM 回答1: read this link It also includes many other useful integration related to ios and libgdx. 来源: https://stackoverflow.com/questions/22025629/libgdx-how-to-integrate-admob-for-both-ios-and-android

Understanding the libGDX Projection Matrix

三世轮回 提交于 2019-12-18 12:49:34
问题 Over the past few weeks I've been attempting to learn the libGDX library. I'm finding it hard, especially for my first endeavor toward game development, to comprehend the system of Camera/viewport relationships. One line of code that I've been told to use, and the API mentions, is: batch.setProjectionMatrix(camera.combined); Despite a good 4 hours of research, I'm still lacking a complete understanding of the functionality of this code. It is to my basic understanding that it "tells" the

How to create an Android 2D game?

别来无恙 提交于 2019-12-18 12:38:26
问题 I'm an dev still learning in Android, I've created two apps so far, an alarm clock, a widget and a pass manager using databases, I have a little bit of experience, but I'd like to create a 2D side scroller game, I check on the web and there are different tutorials, but, what's the best way to start working on it? I've read about libgdx but I'm not sure if it's outdated. I've seen that all the games are made in Java, and then ported to Android, is this correct? I would appreciate some guidance

libgdx: Rotate a texture when drawing it with spritebatch

早过忘川 提交于 2019-12-18 11:29:17
问题 Im trying to rotate textures when I draw them. I figured it would make more sense to do this than to rotate the images 90 degrees in paint.net and save them in different files. I looked thought the api documentation for spritebatch drawing arguments but I just dont understand. There are a bunch of arguments such as srcX, srcY, originX and so on. Also i would like to know how to do the same for texture regions. Heres a link to the api documentation page:http://libgdx.badlogicgames.com

com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: - Error

六月ゝ 毕业季﹏ 提交于 2019-12-18 09:38:32
问题 I am trying to develop an application in libGDX for iOS. In my Java class I have written this line private Texture texture = new Texture(Gdx.files.internal("data/folder_name_1/folder_name_2/abcd.png")); and my robovm.xml looks like this- <iosInfoPList>Info.plist.xml</iosInfoPList> <resources> <resource> <directory>../android/assets</directory> <includes> <include>**</include> </includes> <skipPngCrush>true</skipPngCrush> </resource> <resource> <directory>data</directory> </resource> <

OpenGL is not supported by the video driver

痴心易碎 提交于 2019-12-18 07:45:16
问题 When I use this code: import com.badlogic.gdx.backends.lwjgl.LwjglApplication; import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; public class Main { public static void main(String[] args) { LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); cfg.title = "MtxJungleGameMenu"; cfg.useGL20 = false; cfg.width = 800; cfg.height = 480; new LwjglApplication(new MainStarter(), cfg); } } I get an exception like this: Exception in thread "LWJGL Application" com

Changes in code aren't reflected when I run Libgdx project on Android

吃可爱长大的小学妹 提交于 2019-12-18 06:54:42
问题 I've been following the Libgdx tutorial here and I'm running into a strange problem. Due to the constraints of my work environment, I can't download OpenGL drivers on my desktop, so I can't test my application on the desktop. I have to test it on my Android device. It's running some variation of an Android 2.3.4 build, which is API level 10. The problem is, whenever I make changes to my code and run the Android application, the changes aren't reflected. It just starts the build it installed

Is there a max libGDX texture size for desktop?

早过忘川 提交于 2019-12-18 06:12:47
问题 I know that on mobile devices, the largest texture you could render in a single draw differs: sometimes it is a mere 1024x1024 - other times 2048x2048 etc. What is the case for Desktop games? I am using OpenGL 2.0. I intend to draw one single background sprite that could be as big as 5000x5000. I am guessing that TexturePacker is not quite useful in this scenario, because I don't really need an atlas since I'm just trying to make a single sprite. Yes, I just tested for 5000x5000 and it works

Is there a way to incorporate vector graphics into LibGDX development?

别等时光非礼了梦想. 提交于 2019-12-18 05:54:13
问题 I haven't found anything in LibGDX that would work with vector graphics. This post suggests that AGG is close as it gets, they also mentioned that it is a lot of pain. Is there a painless alternative ? 回答1: There does not seem to be any painless support for vector graphics in Libgdx at this point (mid-2013). First, for vector graphics generally that means SVG in practice. Part of the problem with a "generic" SVG solution is that getting it to work with all the various corner cases seems to be

Background transparency in libgdx

房东的猫 提交于 2019-12-18 05:18:10
问题 How can I make background of screen transparent if I use libgdx in Android? The code I tried to use doesn't work. Gdx.gl.glClearColor( 0, 0, 0, 0 ); Gdx.gl.glClear( GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT ); 回答1: Just found a solution! Just add this code to the class that extends AndroidApplication. AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); cfg.r = cfg.g = cfg.b = cfg.a = 8; cfg.useGL20 = false; View view = initializeForView(new LineDrawing(),