libgdx

Draw Ring with shapeRenderer in LibGDX

ぐ巨炮叔叔 提交于 2020-01-05 22:46:43
问题 I want to draw a ring (circle with big border) with the shaperenderer. I tried two different solutions: Solution: draw n-circles, each with 1 pixel width and 1 pixel bigger than the one before. Problem with that: it produces a graphic glitch. (also with different Multisample Anti-Aliasing values) Solution: draw one big filled circle and then draw a smaller one with the backgroundcolor. Problem: I can't realize overlapping ring shapes. Everything else works fine. I can't use a ring texture,

Draw Ring with shapeRenderer in LibGDX

☆樱花仙子☆ 提交于 2020-01-05 22:44:45
问题 I want to draw a ring (circle with big border) with the shaperenderer. I tried two different solutions: Solution: draw n-circles, each with 1 pixel width and 1 pixel bigger than the one before. Problem with that: it produces a graphic glitch. (also with different Multisample Anti-Aliasing values) Solution: draw one big filled circle and then draw a smaller one with the backgroundcolor. Problem: I can't realize overlapping ring shapes. Everything else works fine. I can't use a ring texture,

Libgdx - min and max of a rotated Bounding Box

倖福魔咒の 提交于 2020-01-05 20:00:32
问题 I am running the simple code below: BoundingBox bounds = new BoundingBox(); Vector3 vmin = new Vector3(); Vector3 vmax = new Vector3(); vmin.x = -1; vmin.y = -2; vmin.z = 0; vmax.x = 1; vmax.y = 2; vmax.z = 0; bounds.set(vmin,vmax); Matrix4 mrot = new Matrix4(); mrot.setToRotation(0, 0, 1, 90); bounds.mul(mrot); Gdx.app.log("xxx","minx " + bounds.min.x); Gdx.app.log("xxx","maxx " + bounds.max.x); Gdx.app.log("xxx","miny " + bounds.min.y); Gdx.app.log("xxx","maxy " + bounds.max.y); Gdx.app.log

LibGDX getBounds not returning correct width

纵饮孤独 提交于 2020-01-05 13:10:31
问题 I am following the answer here: How get a string width in Libgdx? The problem I am having is that the getBounds doesn't seem to return to correct width. My code below should place dots after the end of the string, but you can see dots bleeding through some of the text. How do I get correct width of the text? for (HighScore s : this.scoresData){ font.draw(batch, s.name, x, y); TextBounds nameBounds = font.getBounds(s.name); font.draw(batch, s.value, (float) (KineticAssaultMain.WIDTH / 1.5f), y

LibGDX getBounds not returning correct width

柔情痞子 提交于 2020-01-05 13:09:27
问题 I am following the answer here: How get a string width in Libgdx? The problem I am having is that the getBounds doesn't seem to return to correct width. My code below should place dots after the end of the string, but you can see dots bleeding through some of the text. How do I get correct width of the text? for (HighScore s : this.scoresData){ font.draw(batch, s.name, x, y); TextBounds nameBounds = font.getBounds(s.name); font.draw(batch, s.value, (float) (KineticAssaultMain.WIDTH / 1.5f), y

Libgdx: place 2 actors one on another

谁说我不能喝 提交于 2020-01-05 10:29:15
问题 I use libgdx's scene2d built-in UI library to make an UI in my game. I'm interesting how can I draw 2 images(or actors) in a table one on another? I'm looking to the similar like LayerDrawable in Android. Is there any exists stuff to make it? 回答1: There is a Stack widget in libGDX UI library for these purposes. UPDATE : if you want to place one widget on top of another widget and these widgets have different size then you should wrap the smaller widget. Something like: //First add actual

libgdx iOS robovm no sound unknown ext audio

丶灬走出姿态 提交于 2020-01-05 10:10:13
问题 Tearing my hair out trying to get some sound working on my 99% completed game. I am using libgdx 1.6.1 eclipse juno with the latest robovm plugin for eclipse, I am testing on my iPhone 4s (I have apple dev status). I am using mp3s but have converted to ogg to test my problem. Unfortunately, The same problem came back so I switched back to MP3's. The Sound work fine in desktop and android versions based on the same core code. The error i am getting is the following: 2015-08-03 20:24:51.953

Admob ads giving error code 2 (not displaying)

一世执手 提交于 2020-01-05 09:47:35
问题 I'm trying to make a basic libgdx app and the ads are not being displayed. I'm following these guides: https://developers.google.com/android/guides/setup https://developers.google.com/admob/android/eclipse https://github.com/libgdx/libgdx/wiki/Admob-in-libgdx The code is very basic, just the one copied from the libgdx guide. The code works but the ads are not being displayed. 回答1: Disable your Ad blocker. Make sure you don't have an app like adBlock installed. Anyway, that error means "Timed

3D libgdx rotation

瘦欲@ 提交于 2020-01-05 09:34:58
问题 I think this question is not a duplicate, or if it is, I couldn't understand how to make this work. (sorry for my great drawing capabilities...) I have a ball, radius 0.5 (so, perimeter is 3.1415926). In each frame, I have it in oldPosition and I want to place it in position , so, move in the blue arrow direction, represented by the v vector in the drawing. This is easy. The trick is that I want the ball to be rotated in the target position. The rotation axis should be perpendicular to the

How can I use MultiDexApplication in libGDX for Android

只谈情不闲聊 提交于 2020-01-05 09:29:29
问题 I read many discussions about this topic but no any an exact answer I found. One says you should use Android Studio instead of Eclipse because it supports Gradle and uses Maven building. But I develop games in Eclipse using libGDX and it supports Gradle and Maven building too. Another says you should add multidex.jar from your path SDK tools or from Gradle then enable it inside gradle then extends MultiDexApplication instead of Application then install it inside attachBaseContext method. Nice