libgdx

libgdx Shaperenderer line .. How to draw line with a specific width

六眼飞鱼酱① 提交于 2019-12-05 14:05:34
I am trying to draw a line of specific width using libgdx shape renderer. I followed this link The problem is if i specify more line width i.e more than 9 it does not show increased width. More than 9 either i specify 20 or 100 pixels it will have the same result as 9 shapeRenderer.begin(ShapeType.Line); shapeRenderer.line(50, 70, 0, 50, 200, 0, Color.BLUE, Color.RED); int lineWidth = 20; // pixels Gdx.gl10.glLineWidth(lineWidth / camera.zoom); shapeRenderer.end(); Thanks Shakeel To query the range of supported widths and the size difference between supported widths within the range, call

How to make two bodies stick after a collision?

天大地大妈咪最大 提交于 2019-12-05 13:49:33
I am really stuck on this I can successfully detect a collision but I can't make the two bodies involved in the collision to stick. Here is my ContactListener world.setContactListener(listener); listener = new ContactListener() { @Override public void preSolve(Contact contact, Manifold oldManifold) { } @Override public void postSolve(Contact contact, ContactImpulse impulse) { } //called when two fixtures cease to touch @Override public void endContact(Contact contact) { Fixture fixtureA = contact.getFixtureA(); Fixture fixtureB = contact.getFixtureB(); Gdx.app.log("beginContact", "between" +

libgdx throws exception on Mac, couldn't load shared library libgdx-controllers-desktop.dylib

て烟熏妆下的殇ゞ 提交于 2019-12-05 13:28:34
I have a problem with the libgdx. It Says: Couldn't load shared library 'libgdx-controllers-desktop.dylib' for target: Mac OS X, 32-bit Do anyone have a suggestion? Full Exception: Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Error creating controller manager: com.badlogic.gdx.controllers.desktop.DesktopControllerManager at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:113) Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Error creating controller manager: com.badlogic.gdx

for-loop in shader code working with hardcoded number but not with uniform variable

[亡魂溺海] 提交于 2019-12-05 13:17:38
I asked for help about an OpenGL ES 2.0 Problem in this question . What seems to be the answer is very odd to me. Therefore I decided to ask this question in hope of being able to understand what is going on. Here is the piece of faulty vertex-shader code: // a bunch of uniforms and stuff... uniform int u_lights_active; void main() { // some code... for ( int i = 0; i < u_lights_active; ++i ) { // do some stuff using u_lights_active } // some other code... } I know this looks odd but this is really all code that is needed to explain the problem / faulty behavior. My question is: Why is the

Native libraries not running on the device

你离开我真会死。 提交于 2019-12-05 13:10:25
I've put armeabi,armeabi-v7a folders into libs folder and not in maven repository. But I am getting following error while using libgdx: The library 'gdx-backend-jogl-natives.jar' contains native libraries that will not run on the device. The following libraries were found: libgluegen-rt-linux32.so -libgluegen-rt.jnilib libgluegen-rt-linux64.so libjogl.jnilib libjogl_awt.jnilib libjogl_awt-linux32.so libjogl_awt-linux64.so libjogl-linux32.so libjogl-linux64.so liblwjgl.jnilib liblwjgl.so liblwjgl64.so libopenal.so libopenal64.so Any help will be appreciated. Thanks gdx-backend-jogl-natives.jar

Couldn't load shared library box2d for libgdx

一世执手 提交于 2019-12-05 12:55:20
I have a libGDX project that is built using maven. It's run fine in the past, but recently, it's stopped working, due to libGDX moving box2d to being an extension. I added the extension as a dependency to the core of my project like I would any other dependency: <dependency> <groupId>com.badlogicgames.gdx</groupId> <artifactId>gdx-box2d</artifactId> <version>${gdx.version}</version> <scope>compile</scope> </dependency> however, when I try to run the project for desktop (or anything else, really), I get the following error: [java] Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't

the import com.badlogic.gdx.graphics.gl10 cannot be resolved

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 12:52:57
I dont know why but this is my second libgdx project and it does not work, my mainactivity file is as follows: package com.me.rarster; import android.os.Bundle; import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; public class MainActivity extends AndroidApplication { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); cfg.useGL20 = true; initialize(new rarstertech(), cfg); } } and my other

How to get the world coordinates of a point in a child actor?

限于喜欢 提交于 2019-12-05 12:52:48
I have Group objects that consist of other Group objects, that finally consist of Actor objects. Now, when the groups and actors are rotated, offset and scaled, the coordinates in the "world", or in relation to the root node change. How do I get the world coordinates of a point in an actor's local space? To illustrate a bit more, here's an example of what I want: Group parentGroup; Actor childInGroup; ... parentGroup.addActor(childInGroup); childInGroup.setPosition(10f, 15f); childInGroup.setRotation(45f); // Get the childInGroup's position in the world float childWorldPosX = ...; // This is

Using SVG files with libgdx

為{幸葍}努か 提交于 2019-12-05 12:22:40
问题 I'm planing to create tablet app. I would ask for some guidance. I have pictures in SVG format like this one. With SVG it is easy, You just change fill parameter to different color but as I understand, there is no easy/stable svg processing to use with libgdx. I still want to use svg files to create/store images for my app. What processing path would You recommend? Is there an easy way to convert svg paths/shapes for com.badlogic.gdx.math.bezier or polygon objects and then draw them on screen

What's the right place to dispose a libgdx Screen

落花浮王杯 提交于 2019-12-05 11:56:58
Hello I am working out a game and I wonder how to dispose resources as I am experiencing memory problems. I have something like this: public SplashScreen implements Screen { @Override public void render(float delta) { } @Override public void dispose() { if (batch != null) batch.dispose(); batch = null; } } public MapScreen implements Screen { @Override public void render(float delta) { } @Override public void show() { splashScreenInstance.dispose(); } @Override public void dispose() { if (mesh != null) mesh.dispose(); mesh = null; } } And I am disposing the splash screen as soon as the show