libgdx

the import com.badlogic.gdx.graphics.gl10 cannot be resolved

泪湿孤枕 提交于 2019-12-07 10:33:19
问题 I dont know why but this is my second libgdx project and it does not work, my mainactivity file is as follows: package com.me.rarster; import android.os.Bundle; import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; public class MainActivity extends AndroidApplication { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AndroidApplicationConfiguration cfg = new

Libgdx 3D Texture Transparency

最后都变了- 提交于 2019-12-07 10:20:41
问题 I'm having a problem with a texture on a cylinder. Basically it is a coin with a texture on it, I have done this before as demo but lost the code. Now the problem I'm facing is that I cant get the edge of the coin to be transparent anymore. The transparent parts of the png appear white on the cylinder, or even the box I tried. I enabled G20.GL_Blend, have the blending function with alpha_src and one_minus_alpha_src, enabled something like texture_2d. (Srry for the wrong variable names, only

Libgdx project for iOS displaying libgdx splash when compiling through robovm on simulator?

时光总嘲笑我的痴心妄想 提交于 2019-12-07 10:01:26
问题 How can I remove libgdx splash screen which appears on iOS simulator but doesn't showed up in android emulator. I am compiling my libgdx project through robovm. Thanks 回答1: You will need to replace the various "Default-" images which are in the RoboVM iOS project's "data" folder. These are the iOS "launch images" described here 来源: https://stackoverflow.com/questions/23004517/libgdx-project-for-ios-displaying-libgdx-splash-when-compiling-through-robovm-on

libgdx throws exception on Mac, couldn't load shared library libgdx-controllers-desktop.dylib

删除回忆录丶 提交于 2019-12-07 08:13:34
问题 I have a problem with the libgdx. It Says: Couldn't load shared library 'libgdx-controllers-desktop.dylib' for target: Mac OS X, 32-bit Do anyone have a suggestion? Full Exception: Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Error creating controller manager: com.badlogic.gdx.controllers.desktop.DesktopControllerManager at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:113) Caused

Can I run an Activity before running libgdx?

╄→尐↘猪︶ㄣ 提交于 2019-12-07 07:59:28
Since I have exception running mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); in libgdx's render(), I have an idea to run bluetooth settings first in Android activity and then to close the activity and initialize libgdx. The following code crashes: public class MyActivity extends AndroidApplication { public void onCreate (android.os.Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); Intent myIntent = new Intent(MyActivity.this, StartActivity.class); startActivity(myIntent); initialize(new MyGame(),

Libgdx Scene2d - Set actor ( TextField ) padding?

删除回忆录丶 提交于 2019-12-07 06:24:24
问题 i have been having trouble setting padding or something similar to an actor. Cant figure out the way. I guess that I must add something in the skin maybe? I have this TextField: textboxskin = new Skin(); textboxskin.add("textfieldback", new Texture("data/textfieldback.png")); textboxskin.add("cursor", new Texture("data/cursortextfield.png")); textboxskin.add("selection", new Texture("data/selection.png")); textboxskin.add("font", font); TextFieldStyle textfieldstyle = new TextFieldStyle();

Game crash if interrupted while Splash Screen is on - LIBGDX

本小妞迷上赌 提交于 2019-12-07 05:59:34
问题 I have a splash screen and a menu screen class that loads all my texture atlases and skins for the menu and processes lots of stuff. If I put the constructor for the menu screen in the SplashScreen constructor or in the create() method of my main game class (MyGame class) then it would pass a lot of time with no splash screen render image on the phone while the whole stuff loads so I have delayed the loading of the menu class to the second frame render (gets called in the SplashScreen render

Multi-colored text in libgdx

二次信任 提交于 2019-12-07 05:25:21
问题 I found out there is a new component in LibGDX in nightly builds - TextArea which is part of the scene2d.ui package. It's nice to have a component like this, very easy to use, but what I'm missing is some support for a multi-colored text. I want to highlight some keywords in a text with a different color but I don't know how to do it with current api. There is one method in BitmapFontCache class: public void setColors (Color tint, int start, int end) Javadoc for this method says following:

Libgdx | Scene2d | Set background color of table?

风流意气都作罢 提交于 2019-12-07 05:19:32
问题 I am creating a menu (like the one is flappy bird, when you die it pops up over the play screen). I created a class that extends table, and I want to set the background of the table to white. Is there a way to do this? 回答1: I see that the problem has already been solved, but there are others asking to see the code and I can't comment yet. Here's an implementation of a similar solution, with the exception that a class will be made available for instantiation (so that the Table background color

Libgdx Orthographic Camera initial position

限于喜欢 提交于 2019-12-07 05:06:20
问题 I would like the camera to be positioned correctly but I am getting the result below: It seems like when I resize the window, the map does not get rendered properly. Why does that happen? Code: public void render(float delta){ Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); camera.update(); mapRenderer.setView(camera); mapRenderer.render(background); mapRenderer.render(foreground); shapeRenderer.setProjectionMatrix(camera.combined); //draw rectangles around walls