libgdx

LibGdx - Transition between Screens

白昼怎懂夜的黑 提交于 2020-01-12 03:16:52
问题 I'm trying to change the animation between Libgdx Screens. I want to write my custom animation (fade in, fade out, etc). Can someone give me a clue? I can't seem to find the implementation of the transition in the Libgdx code. 回答1: I've implemented some sliding transitions using Scene2D and the universal tween engine. You can find example code here. http://www.netthreads.co.uk/2012/02/09/libgdx-scene2d-demo-with-scene-transitions/ Update: This article illustrates the approach I took to

Running libgdx html

元气小坏坏 提交于 2020-01-11 13:15:09
问题 I'm trying to understand this great lib. when I'm trying to run html with run as>web application I get errors. here's the console text and gwt definition file. Loading modules com.me.mygdxgame.GwtDefinition Loading inherited module 'com.me.mygdxgame.GwtDefinition' [ERROR] Line 3: Unexpected exception while processing element 'module' java.lang.IllegalArgumentException: No enum const class com.google.gwt.dev.cfg.ModuleDef$ModuleType.LİBRARY at java.lang.Enum.valueOf(Unknown Source) at com

Status of the Loading the TextureAtlas

不问归期 提交于 2020-01-11 13:06:13
问题 I am using the TextureAtlas in my LibGdx based game. As the size of the Atlas increases the loading time increases hence there is a delay in showing the animations that I have setup in the game. Hence I wish to get the status of the loading process of my TextureAtlas. 1. Anyway to get the status ? 2. Any Listener ? 回答1: You can take for example, asset that have been loaded with this method, yourAssetManage.getLoadedAssets () this method return an int indicating the number of loaded assets Gdx

Libgdx camera/scaling issue

爷,独闯天下 提交于 2020-01-11 12:51:30
问题 This is just a really quick post wondering what i have done wrong? I want the background to be filled on the whole screen with whatever screen sizes i have but this does not make it work. Here is all the code: // Variables Jump game; OrthographicCamera cam; SpriteBatch sb; // Variables public SplashScreen(Jump game) { this.game = game; cam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.translate(cam.viewportWidth / 2, cam.viewportHeight / 2); sb = new

Android/Java - Custom View on GoogleMaps FragmentActivity isnt shown

[亡魂溺海] 提交于 2020-01-11 12:50:33
问题 Im trying to draw some Stuff for testing in an Custom View, which is added to the GoogleMaps FragmentActivity. But somehow, when i run it in the emulator, it seems like my CustomView isnt drawing.I tried it with a new RelativeLayout and an MapLayout. Any ideas ? What did i do wrong ? Heres my Main GoogleMaps FragmentActivity code, auto generated from Android templates : public class GoogleMaps extends FragmentActivity implements OnMapReadyCallback { private GoogleMap mMap; @Override protected

Libgdx camera/scaling issue

隐身守侯 提交于 2020-01-11 12:50:31
问题 This is just a really quick post wondering what i have done wrong? I want the background to be filled on the whole screen with whatever screen sizes i have but this does not make it work. Here is all the code: // Variables Jump game; OrthographicCamera cam; SpriteBatch sb; // Variables public SplashScreen(Jump game) { this.game = game; cam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.translate(cam.viewportWidth / 2, cam.viewportHeight / 2); sb = new

Android/Java - Custom View on GoogleMaps FragmentActivity isnt shown

余生颓废 提交于 2020-01-11 12:50:01
问题 Im trying to draw some Stuff for testing in an Custom View, which is added to the GoogleMaps FragmentActivity. But somehow, when i run it in the emulator, it seems like my CustomView isnt drawing.I tried it with a new RelativeLayout and an MapLayout. Any ideas ? What did i do wrong ? Heres my Main GoogleMaps FragmentActivity code, auto generated from Android templates : public class GoogleMaps extends FragmentActivity implements OnMapReadyCallback { private GoogleMap mMap; @Override protected

libgdx changing sprite color while hurt

不羁的心 提交于 2020-01-11 12:32:07
问题 I am using libgdx to make a little platformer and I would like to make the enemies blink in red while the player hurt them with his weapon. I already tried to change the sprite color and the sprite batch color with no success, it only melt the new color with the one of the texture. sprite.setColor(Color.RED); spriteBatch.draw(sprite); the effect I want to achieve is: going from sprite texture to full red and then back again. I think there is something to do with the Blending function, but I

LibGdx 2 half screen “buttons”

谁说我不能喝 提交于 2020-01-11 11:38:07
问题 (Android) So I'm new to LibGdx and I'm trying to code this chrome dino mini game.. I want to make action 1 when the user touch the left hand side of the screen and make action 2 when he touch the right hand side of the screen, how can I do it? 回答1: You can detect the side being touched by using the following code somewhere inside your game loop: if (Gdx.input.isTouched()) { if (Gdx.input.getX() > Gdx.graphics.getWidth() / 2){ //touched right } else { //touchde left } } 来源: https:/

libgdx texture filters and mipmap

China☆狼群 提交于 2020-01-11 04:57:07
问题 When I try to use mipmap filtering in LibGDX, none of the images appear. I'm new to LibGDX, and I have a simple 2d scene with three rotating, scaled circles. In order to anti-alias them, I wanted to use linear filtering. For advice, I looked to this article,which said that, for heavily scaled images, a mipmap can be used to improve speed or quality. The first unexpected appearance was that, despite the fact that all of my images were scaled down, I would only see a linear filter if the