libgdx

libgdx particleEffect rotation

a 夏天 提交于 2019-12-22 05:26:39
问题 I draw fire on my android device with libgdx: ParticleEffect effect; ParticleEffectPool fireEffectPool; Array<PooledEffect> effects = new Array<PooledEffect>(); @Override public void create() { ... effect = new ParticleEffect(); effect.load(Gdx.files.internal("particles/fire01.p"), Gdx.files.internal("image")); effect.setFlip(true, false); fireEffectPool = new ParticleEffectPool(effect, 1000, 3000); PooledEffect myEffect = fireEffectPool.obtain(); myEffect.setPosition(200, 400); effects.add

LibGDX FreeType font blurry

白昼怎懂夜的黑 提交于 2019-12-22 05:19:47
问题 I'm generating my font dynamically using the screen height percentage and set percentages (Obviously multiplied by density's in the future. Some notes. I'm reading from an OTF file. Using the latest version of LibGDX (Version 1.2.0) I have the following problem: (Large breaks in the font and looks very blurry, but only on medium . Large and small look very sharp) My Preset font sizes: //Font sizes, small, med, large as a percentage of the screen. public static float FONT_SIZE_LARGE = 0.175f,

libgdx with displaying Cyrillic

家住魔仙堡 提交于 2019-12-22 05:09:09
问题 I have the following problem with libgdx displaying Cyrillic. I give an example: this works: System.out.println("абцдеф"); but it shows nothing: field = new TextField("абцдеф", style); And tried without success. try { mmm = new String(t.getBytes(), "UTF-8"); } catch (UnsupportedEncodingException e) { // Will it ever be thrown? } field = new TextField(mmm, style); I'll be glad if someone has a solution, many, many will be grateful. 回答1: I think there might be some additional information that

How to make LibGDX Desktop go fullscreen by default

↘锁芯ラ 提交于 2019-12-22 04:37:08
问题 all. Just wondering how to make my desktop app go fullscreen upon start up. I am new to LibGDX and any help is greatly appreciated. Thank you. 回答1: Just define fullscreen field in your LwjglApplicationConfiguration : LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); cfg.title = "yourGame"; cfg.width = 1024; cfg.height = 768; cfg.fullscreen = true; new LwjglApplication(new ...(), cfg); 回答2: To start your game with fullscreen mode set the following flags in

LibGDX draw line

你离开我真会死。 提交于 2019-12-22 04:25:15
问题 I'm trying to make something like a slingshot using libGDX. My code if (Gdx.input.isTouched()) { ShapeRenderer sr = new ShapeRenderer(); sr.setColor(Color.BLACK); sr.setProjectionMatrix(camera.combined); sr.begin(ShapeType.Line); sr.line(player.getLeft().x, player.getLeft().y, Global.game_touch_position.x, Global.game_touch_position.y); sr.line(player.getRight().x, player.getRight().y, Global.game_touch_position.x, Global.game_touch_position.y); sr.end(); } Doing this i will have the output

java.lang.NoClassDefFoundError (libgdx)

人盡茶涼 提交于 2019-12-22 04:12:30
问题 Been trying to work with the Libgdx framework and have been experiencing some frustrating issues.. I'm following a tutorial and I'm unable to run my project. What am I doing wrong? package com.mygdx.game.android; import com.badlogic.gdx.ApplicationListener; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class AndroidLauncher implements ApplicationListener { SpriteBatch batch; Texture mario; @Override public void

How to resolve Gradle plugin dependency?

喜你入骨 提交于 2019-12-22 03:53:07
问题 I am trying to install Eclipse integration Gradle from http://dist.springsource.com/release/TOOLS/gradle in order to create LibGdx project in Eclipse. But there is a dependency issue where I am stuck at and not able to understand the error. Below is the error stack in eclipse while trying to install the Gradle plugin. Software being installed: Spring UAA Integration (optional) 3.6.0.201407080544-RELEASE (org.springframework.ide.eclipse.uaa.feature.feature.group 3.6.0.201407080544-RELEASE)

How to change the size of an existing scene2d.ui widget in a window/table?

强颜欢笑 提交于 2019-12-22 03:52:51
问题 I'm attempting to resize a scene2d.ui window (which is basically a table that can be moved around) and its contents. So far I can only successfully change the window size itself, but not its contents. I'm doing it like this: window.setWidth(newTableWidth); textField.setWidth(newFieldWidth); window.invalidate(); <--- New size of window is drawn properly when invalidate() is called textField.invalidate(); <--- New textField size is NOT drawn, however In this case, the window contains a text

libgdx game crashes on some devices

好久不见. 提交于 2019-12-22 02:34:29
问题 Right after start of app, my app crushes without error message on a device. This only happens on Samsung Note 1(at least, can't test on all devices), but not on Motorola Moto G or Galaxy s4mini. The only hint I get is in the debugger. I pasted it below. What exactly is happening and why it crashes only on some devices? Edit: it crashes also on return to the app from "running apps" menu. Note 1 has CyanogenMod installed. Maybe this has something to do with the crashing. Edit2:Another

Split a Texture into puzzle pieces In libgdx

拜拜、爱过 提交于 2019-12-22 01:31:17
问题 I am trying to convert android Canvas based game to Libgdx due to performance issues. Currently I am facing issues when I have to generate jigsaw puzzle piece sprites (dynamically). What I did : I used android bitmap manipulation (Path and PorterDuff) and generated puzzle pieces and then fed that to Libgdx Game object in AndroidLauncher. Question 1 : Is there a better way to convert a bitmap to puzzle pieces inside libgdx core project. (see below) Question 2 : How can I create an area just to