libgdx

LibGDX: Why my black/white picture gets transparent?

我的未来我决定 提交于 2019-12-24 20:45:36
问题 I have another LibGDX Problem (-_-). I have an black/white image like this: Now I try to use this image as my background image in my PlayScreen: Class PlayScreen: (...) Texture background; (...) background = new Texture("grid.jpg"); (...) gameHandler.getBatch().begin(); gameHandler.getBatch().draw(background,0,0,Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); gameHandler.getBatch().end(); (...) class GameHandler: (...) Gdx.gl.glClearColor(1, 1, 1, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER

Java texture png modificaiton

不打扰是莪最后的温柔 提交于 2019-12-24 20:06:20
问题 I'm trying to make a simple java game. I have some png file that i want to draw, but first i want to make some modification on that png. I would like to take a png, and delete to background some parts of it and add some colored lines.. For my game im using libgdx. I dont know what to use for this, so i can search on google about it and learn. Few hints, about what functions i should use could be awesome, Ty. P.S. I tryed to search on internet before post here, but i didnt find something that

Libgdx. Screen organization

霸气de小男生 提交于 2019-12-24 19:54:59
问题 Good day. How can I organize screen like this? I mean, that screen splitted on 2 parts: game scene and panel. I'm using TiledMap for rendering game space. My code: map = new TmxMapLoader().load("maps/first.tmx"); mapRenderer = new OrthogonalTiledMapRenderer(map, 1f / 32f); cam = new OrthographicCamera(MyWorld.CAMERA_WIDTH, MyWorld.CAMERA_HEIGHT); mapRenderer.setView(cam); In that case game space fills whole screen. Thanks. 回答1: You can use two cameras and overlay them, one renders the game

Pause and continue playing an action on actor in Libgdx

♀尐吖头ヾ 提交于 2019-12-24 19:34:07
问题 I am trying out Libgdx. This is what I am trying to achieve, Define an action on an Actor, while the actor is performing the action, on button click we should be able to start and stop the action, from the same position. I tried this stackoverflow answer but after starting the action again, the actor moves faster then before, because initially we had set duration for the action to be finished, and since less time is left, it runs faster. Can you please help? am I missing anything? 回答1: Try

Updating image in table

醉酒当歌 提交于 2019-12-24 18:13:27
问题 I'm currently creating an inventory system in which the user can select an item from their inventory list collection, and the icon on the right will update. As of now, I've implemented a ClickListener to get the currently selected item from the inventory list and called the .getImage() method that I created to get the icon of the selected item. I used table.add(image); to add the icon to the table. However, when the icon is added to the table, it fills up that space, and another column is

LibGDX Android Game - displaying fixed text (ie Score) over a scrolling screen

ぃ、小莉子 提交于 2019-12-24 18:09:09
问题 I am beginning to write a game in LibGDX, only just beginning. I have got a basic tile map loaded, a player sprite and can move the character around and the screen (camera) scrolls around - perfect. I have two overlayed textures in the bottom right of the screen, a left and right arrow, which are used as the joypad to control the character. I position these in relation to the players.x position, which is always fixed to the centre of the screen. Cool so far .... As below: ////////////////////

LibGDX Android Game - displaying fixed text (ie Score) over a scrolling screen

烂漫一生 提交于 2019-12-24 18:09:02
问题 I am beginning to write a game in LibGDX, only just beginning. I have got a basic tile map loaded, a player sprite and can move the character around and the screen (camera) scrolls around - perfect. I have two overlayed textures in the bottom right of the screen, a left and right arrow, which are used as the joypad to control the character. I position these in relation to the players.x position, which is always fixed to the centre of the screen. Cool so far .... As below: ////////////////////

call Activity when click button on core game LibGDX

谁说我不能喝 提交于 2019-12-24 17:56:52
问题 I have a button on Core game. I want when i click button, a Activity will run. I think i can use Interface but it do not work. buttonPost.addListener(new ClickListener(){ @Override public void clicked(InputEvent event, float x, float y) { myGameCallback.startActivity(); } }); Here is my interface public interface MyGameCallback{ public void startActivity(); } private MyGameCallback myGameCallback; public void setMyGameCallback(MyGameCallback callback){ myGameCallback=callback; } And android

call Activity when click button on core game LibGDX

只愿长相守 提交于 2019-12-24 17:56:05
问题 I have a button on Core game. I want when i click button, a Activity will run. I think i can use Interface but it do not work. buttonPost.addListener(new ClickListener(){ @Override public void clicked(InputEvent event, float x, float y) { myGameCallback.startActivity(); } }); Here is my interface public interface MyGameCallback{ public void startActivity(); } private MyGameCallback myGameCallback; public void setMyGameCallback(MyGameCallback callback){ myGameCallback=callback; } And android

How to develop shared code for a Unity project?

妖精的绣舞 提交于 2019-12-24 17:52:51
问题 If I wrote a game in LibGdx and wanted a shared (reusable in the future) part, then I'd write a library in Java and install it to a local Maven / Gradle repository. End of story. What if I'm using Unity? Do I have to code in C#? Do I have to use VisualStudio / Unity IDE / ... to develop the code? How to make it shared among my projects? 回答1: Unity provides a way to export unitypackages that can help to distribute assets between projects and an assets server that works almost equals to maven