libgdx

GdxRuntimeException on Android: couldn't load shared library 'gdx' for target

那年仲夏 提交于 2019-11-29 06:23:09
I've developed a Libgdx application and tested it on my Samsung Galaxy S3(4.1.2) where it is working great. I tried to test it on a Galaxy Grand(4.1.2) but it failed. In the logcat, I found the following: caused by com.badlogic.gdx.utils.GdxRuntimeException couldn't load shared library 'gdx' for target: Linux, 32-bit This happened when changing the device only so any idea what is the cause?! The complete logcat: 05-22 20:25:01.745: E/AndroidRuntime(12725): FATAL EXCEPTION: main 05-22 20:25:01.745: E/AndroidRuntime(12725): java.lang.ExceptionInInitializerError 05-22 20:25:01.745: E

Error:(2, 0) Plugin with id 'jetty' not found

爱⌒轻易说出口 提交于 2019-11-29 05:55:35
问题 Yesterday I upgraded Android Studio to version 3.0, but I'm working with LibGdx and after the upgrade I cannot build my project. When I'm try to build, it gives me an error: Error:(2, 0) Plugin with id 'jetty' not found How should I fix this? 回答1: Currently html module using deprecated jetty plugin which is removed in Gradle 4.1 version. Android Studio 3.0 using Gradle-4.1 and android-gradle-plugin:3.0.0 Gradle 4.1 is not supported yet in LibGDX, there is an issue for the same, which is now

libGDX Alert Dialog

牧云@^-^@ 提交于 2019-11-29 04:26:10
I have used code below: AlertDialog.Builder bld; if (android.os.Build.VERSION.SDK_INT <= 10) { //With default theme looks perfect: bld = new AlertDialog.Builder(AndroidLauncher.this); } else { //With Holo theme appears the double Dialog: bld = new AlertDialog.Builder(AndroidLauncher.this, android.R.style.Theme_Holo_Dialog_MinWidth); } bld.setIcon(R.drawable.ic_launcher); bld.setTitle("Exit"); bld.setMessage("Are you sure you want to exit?"); bld.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(

How to render a circular/radial progress bar in Libgdx?

99封情书 提交于 2019-11-29 04:04:58
For a game we develop with libgdx, we need to show the user the remaining time for making a move. How can we render a circular progress bar which shows the remaining seconds? In the following answer there is a javascript solution : Circular / radial progress bar Thanks. First create a texture (region) with the full circular progress bar. Next deform a shape (mesh) made up of one or more triangles to fit the actual area which should be shown. For this, think of a line from the center of the image to the bounds of the image. Calculate the intersection point (and "wall", i.e. left, right, top or

LibGDX inside Android Activity

别说谁变了你拦得住时间么 提交于 2019-11-29 03:52:11
I'm in the middle of developing a small app for Android using the Android UI and activities for the most part of the interaction, however one key aspect requires the use of LibGDX (using 3D models and physics). I want to be able to click a button in my app (my "Activate" class) which will open the "AndroidApplication" class (my "Bobble" class) that initializes and runs all the LibGDX code. My problem is that I can't use an "Intent" to start an AndroidApplication class (only an Activity as far as I can tell). I'm sure that people have had to work around this issue in the past so any help would

Split-Screen in LibGDX

怎甘沉沦 提交于 2019-11-29 03:11:03
问题 This question is short and simple. How do I create a split screen effect in LibGDX. If I create two cameras all it will do is draw one located somewhere and then draw the next, overwriting the previous camera. I then thought to use multiple screens but that doesn't look like it will work as it only supports resizing and not relocating within the window. I'm also using Box2DDebugRenderer as well as a ShapeRenderer so it would also need to cut those off at the split-screen limit. There doesn't

How to move a sprite with the keyboard keys using libGDX?

筅森魡賤 提交于 2019-11-29 03:00:00
问题 i have just started using java and libgdx and have this code, very simply it prints a sprite onto the screen. This works perfectly, and i learnt a lot from it. package com.MarioGame; import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic

Producing eraser effects using libgdx and OpenGL ES

旧巷老猫 提交于 2019-11-29 02:52:35
问题 Please consider the following images for the illustration: Initially I fill the whole screen/stage with individual Images until the screen turns pink. Each blob of pink colour is an individual Image actor that I add to the stage. Now I want to implement the touchDown method in such a way that each time the user touches the screen, it erases a part of that Image where the touch event took place. However, that touch event should not effect other Images/actors/TextureRegions that are behind or

LibGDX - Application crashes when call TiledMapRenderer.render()

给你一囗甜甜゛ 提交于 2019-11-29 02:27:38
@Override public void render(float delta) { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); camera.update(); sprite.setProjectionMatrix(camera.combined); mLevel.getTiledMapRenderer().getProjectionMatrix().set(camera.combined); Vector3 tmp = new Vector3(); tmp.set(0, 0, 0); camera.unproject(tmp); mLevel.getTiledMapRenderer().render(tmp.x, tmp.y, camera.viewportWidth, camera.viewportHeight); sprite.begin(); ... sprite.end(); } Here is what I get when launching the desktop version : Exception in thread "LWJGL Application" java.lang.IllegalArgumentException: Number of remaining buffer elements is 0,

LibGDX - Mapping Individual Textures to each face of a box using Modelbuilder.createBox

ぃ、小莉子 提交于 2019-11-29 02:14:01
I have the following code snippet that generates a 3D cube: ModelBuilder modelBuilder = new ModelBuilder(); box = modelBuilder.createBox(2f, 2f, 2f, new Material(TextureAttribute.createDiffuse(AssetLoader.tr[0])), VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal | VertexAttributes.Usage.TextureCoordinates ); So far so good. The problem is that all faces of the cube uses the same texture, whereas what I want is Assetloader.tr[], which is an array with 6 individual textures to appear on each face respectively. I have tried box.nodes.get(0).parts.get(0).material.set(new Material