libgdx

Strange blending when rendering self-transparent texture to the framebuffer

坚强是说给别人听的谎言 提交于 2019-12-08 09:14:35
问题 I'm trying to render self-transparent textures to the framebuffer, but I'm getting not what I guessed: everything previously rendered on the framebuffer gets ignored, and this texture blends with the colour I cleaned my main canvas. That's what I would like to get, but without using framebuffers: package test; import com.badlogic.gdx.*; import com.badlogic.gdx.graphics.*; import com.badlogic.gdx.graphics.g2d.*; public class GdxTest extends ApplicationAdapter { SpriteBatch batch; Texture img;

Scrollable html list in libgdx

雨燕双飞 提交于 2019-12-08 09:06:49
问题 I want to make achievements table in my libgdx game. Is there any component in libgdx wchih i can use? For example something that allows me to turn screen into html page or something like this. 回答1: simple test for you start: Variable Class: Stage stage; ScrollPane scrollPane; Table outerTable, innerTable; . @Override public void show() { stage = new Stage(); outerTable = new Table(); innerTable = new Table(); image = new Image(new Texture( Gdx.files.internal("badlogic.jpg"))); //innerTable

Setting boundaries to world in libgdx

霸气de小男生 提交于 2019-12-08 09:01:14
问题 Hi I am developing a game using libgdx framework, in that i am unable to set boundaries to the world in order to limit the actors. When ever a fixture crossed the screen(world) edge it should revert back or stop there itself. I know by calculating x,y co-ordinates we can do it, if there any other way please help in this regard. 回答1: got resolved.. by setting edges to shapes 来源: https://stackoverflow.com/questions/6730981/setting-boundaries-to-world-in-libgdx

save data with preferences in libGDX

若如初见. 提交于 2019-12-08 08:57:34
问题 In My game project, I want to save some data of levels like coins, gams, ... etc with preferences interface. I supposed In My Question here the data is the level number only. ........................................................................ 1) If the player finish the level_1, this code called to save LEVEL_NUM_ . preferences.putInteger("LEVEL_NUM_", getLevelNum()); preferences.flush(); The .prefs 's file : <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE properties

LibGDX blinking

时光怂恿深爱的人放手 提交于 2019-12-08 08:32:10
问题 I've used the LibGDX UI Setup to start a project. The only thing I have in the implements ApplicationListener is: public void create() { setScreen(new LoadingScreen(this)); } This is supposed to fire the LoadingScreen and it does since I have a print in its constructor and it does show. I have a print in the render method and it's only shown once and I understand this should be printed a lot of times since the render method is called every short period of time. Here's what I have in the

Scene2d tables turn black on one phone after a few game resets

浪子不回头ぞ 提交于 2019-12-08 08:17:07
问题 My game screen uses both Scene2d and normal libgdx sprites. I use scene2d for the pause menus which contain some tables and textbuttons. All is ok on the pc. All is ok also on two mobile phones I'm testing the game on, but I have a pb on a third phone. It seems that after a restart or two of the game level all the scene2d elements that are supposed to appear on the screen have turned black. They are still responsive, meaning the buttons do what they are supposed to do, they move rotate and

Shaders in libgdx have no effect [Desktop]

对着背影说爱祢 提交于 2019-12-08 07:34:00
问题 This is mostly a general question, since I can't get any shader to work at all. The usual sprites and textures render just fine, it just doesn't happen anything with the shaders. Not getting any error messages from the shader log either. As far as I understand, for a filter of the type below, one only need to set the shader to the batch, like batch.setShader(shader), and set any uniforms, and the batch will take care of the rest. If I am wrong, please tell me my errors. Fragment shader,

LibGDX: How to Implement Google Play Game Services? [closed]

折月煮酒 提交于 2019-12-08 07:29:03
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I checked [https://github.com/libgdx/libgdx/wiki/Google-Play-Games-Services-in-LibGDX][1] but that tutorial requiers me to import BaseGameUtils from here: [https://github.com/playgameservices/android-basic-samples][2] but it seems that the BaseGameUtils was removed. How can I go

LibGDX, OpenGL 2.0 and textures having to be powers of two?

喜你入骨 提交于 2019-12-08 07:21:16
问题 I understand that when using OpenGL 2.0 and libGDX my texture images have to be of a power of two. This is stated on this page https://github.com/libgdx/libgdx/wiki/Textures,-textureregion-and-spritebatch. One thing that I cannot understand is that this is not always true. I am creating an app that has a splash screen and the texture that I use is loaded directly in the class declaration (the Screen) like below; private TextureRegion textureRegion = new TextureRegion( new Texture(Gdx.files

Can I run an Activity before running libgdx?

谁说我不能喝 提交于 2019-12-08 06:47:45
问题 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 =