libgdx

LibGDX/Box2D UnsatisfiedLinkError

假如想象 提交于 2019-12-10 11:19:53
问题 I'm using the EXACT same code as used in this tutorial but for some reason I get an error while trying to run the project. The default project for LibGDX worked fine. Error: Exception in thread "main" java.lang.UnsatisfiedLinkError: com.badlogic.gdx.physics.box2d.World.newWorld(FFZ)J at com.badlogic.gdx.physics.box2d.World.newWorld(Native Method) at com.badlogic.gdx.physics.box2d.World.<init>(World.java:222) at net.ocps.tchs.permarun.PermaRun.<init>(PermaRun.java:19) at net.ocps.tchs.permarun

LibGDX Stencil Buffers while using SpriteBatch

不想你离开。 提交于 2019-12-10 11:17:01
问题 This is a continuation of my previous problem and post, seen here. Thanks to the answer I received there I feel I was able to get a little closer to my goal, as well as further my learning of OpenGL, but shortly after figuring out the basics of working with stencil buffers, I've run into a problem. It seems that when I draw a sprite to the stencil buffer, it draws the entire square area, rather than just the pixels that aren't fully transparent as I had ignorantly hoped. I vaguely understand

Adding admob underneath game view

泪湿孤枕 提交于 2019-12-10 10:35:10
问题 I have been trying to put admob underneath my game view. here is my code public class HoodStarGame extends AndroidApplication { @Override public void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Create the layout RelativeLayout layout = new RelativeLayout(this); // Do the stuff that initialize() would do for you requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG

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

落爺英雄遲暮 提交于 2019-12-10 09:34:05
问题 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 回答1: To

libgdx- pixmap: can I somehow change the width of the line?

风流意气都作罢 提交于 2019-12-10 09:09:34
问题 I want to draw a line and then generate a texture (with libgdx). I found out that creating a texture from circles, rectangles and lines is simple with pixmap. But I didn't find out how to set the linewidth of the drawn shape. Is there any possibility to set the linewidth for pixmap? Here is the code I got so far: (I tried to draw two filled circles and to connect them with a line) Pixmap pixmap = new Pixmap( 16, 16, Format.RGBA8888 ); pixmap.setColor(Color.BLUE); pixmap.fillCircle(x1, y1, 10)

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

三世轮回 提交于 2019-12-10 07:01:03
问题 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

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

大城市里の小女人 提交于 2019-12-10 05:37:14
问题 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

Libgdx - Check if a key is being held down?

吃可爱长大的小学妹 提交于 2019-12-10 04:00:31
问题 I'm using the java libgdx game library and im curious if I can tell if a key is being HELD, not pressed and let go. I need to know this because I'm going to play a shorter mp3 file if it is just pressed and a longer one if it is held. 回答1: Yes, you can easily check they either via Gdx.input.isKeyPressed(Input.Keys.XXX) or by implementing an InputProcessor. public class MyInputProcessor implements InputProcessor { public boolean keyPressed; @Override public boolean keyDown(int keycode) { if

Trying to run Android game using libgdx on Genymotion

落花浮王杯 提交于 2019-12-10 03:31:42
问题 Anybody experienced with libgdx and genymotion? I'm trying to get a libgdx game running on genymotion android emulator - http://www.genymotion.com/ Everytime I try to run on genymotion I get the following exception: java.lang.ExceptionInInitializerError at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1319) at android.app.Instrumentation.newActivity(Instrumentation.java:1053) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java

Can't add gdx-tools to libgdx gradle project

北城余情 提交于 2019-12-10 02:39:46
问题 I'm new in Gradle. I'm trying to add gdx-tools to my project: project(":desktop") { apply plugin: "java" dependencies { compile project(":core") compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop" compile "com.badlogicgames.gdx:gdx-tools:$gdxVersion" } } I open my Desktop project, folder "Gradle Dependecies" and see "gdx-tools-1.0.1