libgdx

libGDX - gdx-backend-jglfw is missing and some others

折月煮酒 提交于 2019-12-12 04:36:58
问题 I am new to libGDX and trying to compile the source, I have eclipse Luna 4.4.1 jdk1.8.0_11 installed, and JAVA_HOME is set jre8 ant version 1.9.3 // executed ant -f fetch.xml in libGDX filder clean all projects but as I have touched nothing in the project there are 25 errors, it is my first JAVA-libGDX attempt and dying here... Description Resource Path Location Type Project 'gdx-backend-jglfw' is missing required library: '/gdx/libs/gdx-natives.jar' gdx-backend-jglfw Build path Build Path

Texture packing animation images/Sprite sheets efficiently-Libgdx

僤鯓⒐⒋嵵緔 提交于 2019-12-12 04:32:13
问题 For my LibGdx project,I have assets including single images and sprite sheets for animation.I know it is efficient to pack everything in to a single atlas. But when it comes to sprite sheets,how can I pack it?Do I have to use a single sprite sheet or single images of a sprite sheet while packing? Eg:I have a sprite sheet named 'snake' with 4 frames. also I have snake frames in snake_01,snake_02,snake_03 and snake_04. Which one is the better way? 回答1: The second way is much less time consuming

How can I add TeaVM to my existing libGDX project?

不想你离开。 提交于 2019-12-12 04:19:12
问题 TeaVM is an alternate to GWT that compiles Java to byte code allowing for the usage of things like Scala and Kotlin, I am having a difficult time understanding the process of adding and running my libGDX project in TeaVM, I would greatly appreciate any assistance or directions on how to run the project after adding the dependencies into my build.gradle file. Thanks! 来源: https://stackoverflow.com/questions/45108401/how-can-i-add-teavm-to-my-existing-libgdx-project

Unable to detect if a rectangle is touched in libgdx

岁酱吖の 提交于 2019-12-12 04:08:09
问题 I have a rectangle with a sprite on it and I have to detect if the touch position lies within the rectangle. This is my code, if (Gdx.input.isTouched()) { int x1 = Gdx.input.getX(); int y1 = Gdx.input.getY(); Vector3 inputs = new Vector3(x1, y1, 0); gamecam.unproject(inputs); Gdx.app.log("x" + inputs.x, "y" + inputs.y); Gdx.app.log("rect" + rectangle.x, "rect" + rectangle.y); if(rectangle.contains(inputs.x,inputs.y)) { Gdx.app.log("x" + inputs.x, "y" + inputs.y); Gdx.app.log("rect" +

libgdx: The declared package does not match the expected package “”

你离开我真会死。 提交于 2019-12-12 04:07:23
问题 I'm working with LibGdx and Eclipse, I used the latest version and the setup tool that creates the project for Android, desktop and another one named "core", I imported in Eclipse, but I keep getting this error in both desktop and android projects: The declared package "com.mygdx" does not match the expected package "" Could you help me out please? Thanks in advanced! 回答1: Just in case someone might find it useful, the actual problem was to add numbers in the project's name, that's why the

LibGDX scale a slider, HOW?

*爱你&永不变心* 提交于 2019-12-12 03:57:54
问题 How can I scale a slider in LibGDX? Im trying to scale a slider with: slider.scale(10); (for example) but when I try that i cant interact with the slider that leads to me thinking that the slider ist scaled but rendered normally. I render it with slider.draw(batch, 1); Has anyone got an idea? 回答1: For performance reason most scene2d.ui groups have transform set to false by default. For more detail you can check https://github.com/libgdx/libgdx/wiki/Scene2d.ui#rotation-and-scale If you want to

Android libGDX error on launch No JNI_Onload found

拈花ヽ惹草 提交于 2019-12-12 03:49:45
问题 My game runs on the Desktop, but when I launch on Android I can see these messages appearing in the log. 04-01 21:50:10.314: D/ActivityThread(21047): setTargetHeapConcurrentStart:2097152 04-01 21:50:10.334: D/dalvikvm(21047): Trying to load lib /data/data/com.vulcanic.flickit/lib/libgdx.so 0x41e53a48 04-01 21:50:10.334: D/dalvikvm(21047): Added shared lib /data/data/com.vulcanic.flickit/lib/libgdx.so 0x41e53a48 04-01 21:50:10.334: D/dalvikvm(21047): No JNI_OnLoad found in /data/data/com

Designing a simple event-driven GUI

谁说胖子不能爱 提交于 2019-12-12 03:39:43
问题 I am creating a simple event-driven GUI for a video game I am making with LibGDX. It only needs to support buttons (rectangular) with a single act() function called when they are clicked. I would appreciate some advice on structuring because the solution I've thought of so far seems to be far from ideal. My current implementation involves all buttons extending a Button class. Each button has a Rectangle with its bounds and an abstract act() method. Each game screen (e.g. main menu, character

Game Running slow in Android Handsets, no use of textures only using ShapeRenderer to draw shapes

a 夏天 提交于 2019-12-12 03:28:15
问题 I am making a game in which i am making arcs using ShapeRenderer , As i needed to rotate those arcs around the center so i wrote that code only begin and end in render method, I am initializing them in create method , But as the number of arcs increases the game gets slower and slower. I have maximum of 13 arcs and minimum 2 arcs . It running fine till few say 8 arcs and after that it gets slower. Please any one out there if he/she can help, please help... thanks in advance. Render Method is

AndroidStudio libgdx ChangeListener not working

老子叫甜甜 提交于 2019-12-12 03:27:33
问题 Android Studio-libgdx making a 2d game. I have a Main which creates the MenuState, in the render method I made this @Override public void render(float delta) { Gdx.gl.glClearColor(0, 0, 0.2f, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); camera.update(); myGame.batch.setProjectionMatrix(camera.combined); batch = new SpriteBatch(); skin = new Skin(Gdx.files.internal("data/uiskin.json")); stage = new Stage(); final TextButton button = new TextButton("Click me", skin, "default"); button.setWidth