libgdx

Rendering 2D array Libgdx Java

喜你入骨 提交于 2019-12-12 01:44:22
问题 I want to create a random tiled map for my game, this is what I have so far: switch(MathUtils.random(2)){ case 0: tileX+=16; loadedTiles ++; //game.batch.draw(tile1, tileX, tileY); System.out.print("tile1"); currentTile = tile1; break; case 1: tileX+=16; loadedTiles ++; //game.batch.draw(tile2, tileX, tileY); System.out.print("tile2"); currentTile = tile2; break; case 2: tileX+=16; loadedTiles ++; //game.batch.draw(tile3, tileX, tileY); System.out.print("tile3"); currentTile = tile3; break; }

Publish libgdx game to Google Play

这一生的挚爱 提交于 2019-12-12 01:40:39
问题 I just finished up publishing an app to the Google Play store, but when I downloaded it from the store on another phone, it didn't run at all. I set up my libgdx app project based off of this website: http://obviam.net/index.php/getting-started-in-android-game-development-with-libgdx-create-a-working-prototype-in-a-day-tutorial-part-1/comment-page-2/ which basically had me type all my game code in a Java Project, then launch that from an Android Application Project. Here is my code for the

BSpline derivativeAt() method does not return correct value

会有一股神秘感。 提交于 2019-12-12 01:38:12
问题 I am having problems with the derivativeAt() method when using the BSpline path because it is not returning the correct values, however the derivativeAt() method works find for the CatmullRomSpline path so this is something specific to SPline. The wiki and API do not mention that the SPline needs to be treated differently from other paths...is there something that I’m missing with SPline, or is this a bug with LibGDX? I made a simple program to show the problem. It draws the control points

LibGDX Nesting Tables for gameboard grid

天涯浪子 提交于 2019-12-12 01:19:10
问题 I am playing with LibGDX and trying to set up a simple board game. public void show() { width = Gdx.graphics.getWidth(); height = Gdx.graphics.getHeight(); viewport = new FitViewport(STAGE_WIDTH, STAGE_HEIGHT); stage = new Stage(viewport); sceneBoard = new GridSceneBoard(10, 30, GridBoardCell.Type.CHECKERED); rootTable = new Table(); rootTable.setFillParent(true); sceneBoard.setFillParent(true); rootTable.add(sceneBoard); stage.addActor(rootTable); Gdx.input.setInputProcessor(stage); } a

libGDX ViewPort Android devices

大城市里の小女人 提交于 2019-12-12 01:13:46
问题 How can i use the fitviewport or viewport? i need to fit the screen to many android devices as posible. I dont have idea how to use that, thank you for your help, if you can paste some code for me i aprecciate that... public void show(){ batch = main.getBatch(); texture = new Texture(Gdx.files.internal("spacebg.png")); Texture texturaBola = new Texture(Gdx.files.internal("bola.png")); ball = new Ball(Gdx.graphics.getWidth() / 2 - texturaBola.getWidth() / 2, Gdx.graphics.getHeight() / 2 -

I get errors when i start libgdx gdx-setup-ui

拈花ヽ惹草 提交于 2019-12-12 00:48:29
问题 When I start gdx-setup-ui at the bottom bar, there pops 2 red balloon saying Master config file 0/?? (?%) and Version number 0/??(?%) . In the description of errors it says: Ioexception sun.security.validator.validatorexception pkix path building failed: sun.security.certpath.SunCertPathBuilderException: unable to find valid certific ation path to requested target I get this error on my desktop PC, but i can use it without any problems on my laptop. What can I do to solve this? 来源: https:/

Android. LibGDX. How to move and orient 3D-object along a spline

二次信任 提交于 2019-12-11 23:51:02
问题 I'm using LibGDX for my Android app. I need to move and orient 3D object(ModelInstance) along a spline.In my case it's CatmullRomSpline. I got the movement working but having problem with orienting the ModelInstance along the spline. My Code: public void update() { float t = SPEED * Gdx.graphics.getDeltaTime(); elapsedTime = elapsedTime + SPEED * Gdx.graphics.getDeltaTime(); //Movement catmull.valueAt(value, elapsedTime); myObject3d.transform.setTranslation(value); //Rotation derivative =

Libgdx align does not work

余生颓废 提交于 2019-12-11 23:46:19
问题 After scaling down "Forgot Password:(" button, seems like its cell did not scale down. The result for that is that cell contents are in the bottom left of the cell. I need it to be aligned to the center or I need to scale down the cell to content's size. Here is the screenshot: And the code: Table tableRoot = new Table(); tableRoot.setFillParent(true); tableRoot.padTop(40); tableRoot.align(Align.center); final Label hint = new Label("Wrong password", Utility.UI_SKIN, "default-text"); hint

Google Developer Console shows 0 supported devices

帅比萌擦擦* 提交于 2019-12-11 23:08:15
问题 I want to publish my app on Google Play but when I upload my .apk file, it shows that it is supported by 0 devices. I know that there is already a few topics about this but I have not find solution in any of them. Below I am attaching source-code of my android manifest. I also would like to mention that I am using LibGDX for this application and it is an Android Live Wallpaper. Also everything works fine on test devices and emulator. Thanks for your answers. <?xml version="1.0" encoding="utf

Error when launching Java app on desktop using LibGdx/Eclipse

好久不见. 提交于 2019-12-11 22:34:17
问题 I'm using LibGdx to develop a Java-based game. I haven't decided whether I want the game to be deployed on Android or PC, so I figured I can at least develop+test on desktop and then decide. I've used LibGdx before and it worked fine.. but that must been before I did a complete system wipe (as I like to do a few times per year). Anyhow, when I try to launch the game in Eclipse as "Java Application" I get the following errors: - Exception in thread "LWJGL Application" com.badlogic.gdx.utils