libgdx

BitmapFont rendering artifacts

橙三吉。 提交于 2019-12-11 13:44:47
问题 I have setup scaling of GUI to occupy whole screen (window). Control widgets are fine, but scaling of fonts is terrible - there are artifacts from neighbouring glyphs (because of some rounding errors I suppose). You can quite clearly see it on a right side of T: I tried setting various values in padding area in Hiero, but all those values affect how font is rendered - they add space between characters in rendering, not just to a texture as I wanted. Any idea how to fix this artifacts? I don't

LIBGDX - Accessing Android package variables

本小妞迷上赌 提交于 2019-12-11 13:42:50
问题 I need to read the value of some variables that are in AndroidLauncher on Android package through a class in Core package. As below, I need to read the value of interstitial variable. AndroidLaucher on Android: public static int interstital=0; public int ads() { // TODO Auto-generated method stub return interstital; } GameScreen on Core: System.out.println(AndroidLaucher.ads()); I tried to implement an interface, but it does not support static methods. How to return the value of this variable

Adding share button to LibGDX for android and iOS

青春壹個敷衍的年華 提交于 2019-12-11 13:40:24
问题 I am trying to add a button which when pressed shares the high score of the user to the chosen app (facebook, twitter, messaging etc...) I have been searching online and I just could not find a clear tutorial on how to do this. It may be because I am not so familiar with the terms such as bindings etc.. so I cannot understand these advanced tutorials. Can anyone explain clearly how I could do this? Thanks! p.s it would be great for the share button to work for both android and iOS 回答1: For

How can I set timer in LIBGDX

自闭症网瘾萝莉.ら 提交于 2019-12-11 13:29:21
问题 I want to change my balloon's location (randomly) in every second. I wrote this code: public void render() { int initialDelay = 1000; // start after 1 seconds int period = 1000; // repeat every 1 seconds Timer timer = new Timer(); TimerTask task = new TimerTask() { public void run() { rand_x = (r.nextInt(1840)); rand_y = (r.nextInt(1000)); balloon.x = rand_x; balloon.y = rand_y; System.out.println("deneme"); } }; timer.schedule(task, initialDelay, period); Gdx.gl.glClearColor(56, 143, 189, 1)

Timer stops working after app resume (Android)

大憨熊 提交于 2019-12-11 12:58:13
问题 I'm using three timer to trigger different periodic tasks (not all enabled at the same time). However after pausing/resuming the app (by switching to a different app), some of the timers stop working. After reading through the web I found that there was a bug in libGDX related to this, but it has already been fixed. Awkwardly enough, only two of the timers stop working while the third one works fine. @Override public void create ( ) { createTimers(); easterTimer.start(); inputTimer.stop();

Render polygon with repeate Texture in Libgdx using PolygonSpriteBatch

霸气de小男生 提交于 2019-12-11 11:50:48
问题 I would like to draw a polygon with repeat texture (e.g brick). Here is my code: textureBrick = new Texture(Gdx.files.internal("data/brick.png")); textureBrick.setWrap(TextureWrap.Repeat, TextureWrap.Repeat); TextureRegion texreg = new TextureRegion(textureBrick,0,0,1f,1f); texreg.setTexture(textureBrick); PolygonRegion po = new PolygonRegion(texreg, floatvertices); and next i draw (render): public void render(SpriteBatch spriteBatch, PolygonSpriteBatch polygonBatch) { Gdx.gl.glEnable(GL10.GL

Showing non-western language from right to left in libgdx (Android)

允我心安 提交于 2019-12-11 11:08:54
问题 This is my problem: I'm using Hiero to generate a font for my libgdx game (files .fnt and .png).I success to generate a custom font, but for laguage like arabic (writing text from right to left). i show the result starting from left to right but me i want to show it from right to left. example: For the world "النتيجة" I show in the game :"ةج ي ت ن لا" I if any one have a procedure/ or experience whith a non-western language how to showing the text from right to left?. thanks. 来源: https:/

Updated eclipse, adt, Libgdx doesn't compile on android

左心房为你撑大大i 提交于 2019-12-11 09:59:10
问题 I'm currently using libgdx for game I'm writing, and I just continued writing this game from around 2 months ago, so I started up eclipse, updated everything ( took a while ) and then proceeded to program on the pc, fixing some bugs and adding stuff. Later I tried to run it on my android (Galaxy Nexus) but I got an error: 04-24 09:51:57.620: E/dalvikvm(19561): Could not find class 'com.thundergodpc.ThunderGod', referenced from method com.thundergodandroid.ThunderGodActivity.onCreate 04-24 09

how to get a perspecitve look to an orthogonal tilemap

做~自己de王妃 提交于 2019-12-11 09:43:24
问题 I am currentliy using an orthogonal map, not an isometric. But I would like to get an perspective look. the first picuture shows, what I currently have, the second shows my goal. Isn't it possible to do it with a transform matrix somehow? I did only manage to scale the whole image.. 回答1: You can use MapRenderer.setView(...) to achieve that. Create a PerspectiveCamera and set it up to have the perspective that you've shown in your second picture. Note that the tiled map will be rendered to the

Deleted picture still visible in gallery

半城伤御伤魂 提交于 2019-12-11 09:37:10
问题 I have a small problem here. In my application I let the user select a picture from the gallery. I save the path to it before doing anything else. When the user picks the picture he wants, I want it to be copied in a other folder, and then deleted from the original one. Well, it kiiinda works. The original picture is deleted, and a copy appears in the other folder. Buuut. It's still there. The deleted picture can still be seen in the gallery, and the copy can't be seen. When I call Gdx.files