libgdx

libgdx Background TextureRegion repeat

老子叫甜甜 提交于 2019-12-10 19:15:41
问题 I'm new in libdgx developement and also in game developement. I am reading the book "Learning Libgdx Game Development" from Andreas Oehlke and I am trying to develop my own game in parallel. I have a problem when I try to add the background. In the book, he uses a color, so it's very simple. But I want to add an image from a texture atlas. The image is to small to recover all the screen, so I want to repeat it. I can't use regBackground.setWrap(TextureWrap.Repeat, TextureWrap.Repeat) because

Load images in Android app with libgdx

流过昼夜 提交于 2019-12-10 19:13:43
问题 I've gone through the nice tutorial that creates a simple libgdx game catching raindrops in a bucket. I want to learn more about using images, so I tried replacing the raindrop with a baby. When I try loading baby.png, I get the following error: com.badlogic.gdx.utils.GdxRuntimeException: Texture width and height must be powers of two: 60x83 How can I load an image of whatever size I want? 回答1: before loading the image write.. Texture.setEnforcePotImages(false); you may do this in create

Libgdx - Support for OpenGL 4+

旧城冷巷雨未停 提交于 2019-12-10 18:18:37
问题 Is it possible to use Libgdx for a desktop development only and access newer versions of Opengl from Libgdx abstraction? I mean, if you want to develop mobile apps you will have to use a some verison of Opengl ES, which does not support lot of things like classic Opengl does (e.g. drawing wireframes, etc.). Lets say I don't want to use Opengl ES but normal Opengl, version 4+ in these days, and fully use its features for oa desktop development. Does Libgdx have support for this? 回答1: On the

FLAG_SECURE not working on libgdx's AndroidApplication

回眸只為那壹抹淺笑 提交于 2019-12-10 18:16:43
问题 I have an Android game created with help of libGDX. I want to disable the ability to take screenshots. For regular android activities you can use getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE); method. It works fine. But it doesn't work with activities extended from com.badlogic.gdx.backends.android.AndroidApplication . I'm still able to take screenshots. Any ideas? 回答1: Calling initialize in AndroidApplication sets up the window parameters for a full-screen game, so

Real time game development

与世无争的帅哥 提交于 2019-12-10 18:08:52
问题 I want to develop a real time game for Android with libgdx. I need to update some variables even dough the game is not running. For example I want the money to be increased 10 credits per hour (real life hour) so that you can go out of the game and come back an hour later and get that money anyway. How can I do that? Thanks 回答1: For real time, no need to setup your own server. Just use one of the public time server. Download NtpMessage.java and SntpClient.java from ntp site. Then run

Unexpected response code 403 for https://www.googleapis.com/games/v1/players/xxxxx LibGDX Android

无人久伴 提交于 2019-12-10 18:07:46
问题 I'm making a Android game with LibGDX and I want to use the Google Play Game Services API but I can't get it working. Here's what happens when I try to login: 06-12 20:08:47.745: E/Volley(4046): [253] tk.a: Unexpected response code 403 for https://www.googleapis.com/games/v1/players/115171141636978128288 06-12 20:08:47.846: E/SignInIntentService(4046): Access Not Configured. Please use Google Developers Console to activate the API for your project. 06-12 20:08:47.846: E/SignInIntentService

UnsatisfiedLinkError on iOS but not Android, loadLibrary always succeeds

回眸只為那壹抹淺笑 提交于 2019-12-10 16:56:56
问题 I have some Java and C++ code that I can compile on both platforms and build native libraries. I can verify that the libraries contain the functions I expect, and Java is able to load the libraries on Android and iOS. On Android everything goes smoothly with no crash, but on iOS I get a very frustrating error: 2015-05-11 11:34:48.418 IOSLauncher[52454:851038] [info] test: initializing native libraries... 2015-05-11 11:34:48.418 IOSLauncher[52454:851038] [info] test: library path set to: "

Libgdx TiledMap bug in render

有些话、适合烂在心里 提交于 2019-12-10 16:48:10
问题 I do a Mario like game with the libgdx library. All works fine but sometime (especially when the camera goes fast) my TileMap has a little bug during the render. A picture worth thousand word, so here it is : http://postimg.org/image/4tudtwewn/ I have tried to increment FPS, but there is no change. I have no idea where that is come from. Here is my code : public void show() { TmxMapLoader loader = new TmxMapLoader(); this.plan = loader.load("maps/level-"+this.world+"-"+this.level+".tmx");

Merging Models from ModelBuilder in LibGDX

杀马特。学长 韩版系。学妹 提交于 2019-12-10 15:58:59
问题 I'm a new to LibGDX 3D facilities and I'm wondering how I can merge two cylinders created using the ModelBuilder#createCylinder class.I have two ModelInstances : The first one is a white cylinder, The second a red cylinder with the same properties How can get only one cylinder to render (instance / model / object / whatever can be rendered) composed of the red above the white one (or vice versa). Pixmap pixmap1 = new Pixmap(1, 1, Format.RGBA8888); pixmap1.setColor(Color.WHITE); pixmap1.fill()

Gradle how to add native dependency? [Libgdx]

与世无争的帅哥 提交于 2019-12-10 15:57:10
问题 I have a default Libgdx Gradle setup, and I need to add my simple text rendering library to it. It consists of a .jar file and native lib file. This line of build.gradle script seems to work as I would expect, and what it does is add jfreetype.jar java library to my build path. compile files('../local_lib/jfreetype.jar') Is there a magic command like this to add native library (.dll to be exact) that is available on my file system and is not Mavenized? natives "../local_lib/jfreetype32.dll"