libgdx

Getting java.net.MalformedURLException in MonoDeveloper

情到浓时终转凉″ 提交于 2019-12-04 04:20:23
问题 Hey I am new to MonoDeveloper. I am trying to port libgdx code to iOS platform. My Libgdx code runs perfectly on desktop & Android phone. But when i run it on iPhone simulator with MonoDeveloper its giving me this error: Unhandled Exception: 0 iosgame [ERROR] FATAL UNHANDLED EXCEPTION: java.net.MalformedURLException: unknown protocol: file. 0x000e8932 mono_handle_exception_internal_first_pass + 3058 1 iosgame 0x000ea012 mono_handle_exception_internal + 1602 2 iosgame 0x000eab5f mono_handle

Switching from AndEngine to libgdx - what to know? [closed]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 04:09:57
Closed . This question needs to be more focused. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed 6 years ago . I've been testing with AndEngine for months, but still haven't produced any game prototypes. There are few reasons why I want to switch to libgdx: - AndEngine is using libgdx's INI wrapper for Box2d, but updates reach Andengine slowly - I'm primarily targeting Android, but having option for easy porting to other platforms could come handy - Documentation! AndEngine

LibGDX - How to smooth out actor drawable when scaling a Scene2d stage?

偶尔善良 提交于 2019-12-04 04:05:56
This is my set-up: stage = new Stage(1280, 800, false); button = new Button(drawableUp, drawableDown); stage.add(button); this gets rendered as following: @Override public void render(float delta) { Gdx.gl.glClearColor(RED,GREEN,BLUE,ALPHA); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); stage.act(delta); stage.draw(); } The issue is that when the stage is shown on 1280x800 the button looks like that: If the stage is rescaled to e.g. 1280x736, the button drawable is scaled in the following way: Is there a way to smooth out the edges somehow? Because right now it looks to me that the scaling is

overriding drawing order scene2D's stage

匆匆过客 提交于 2019-12-04 03:57:40
You are given a complex Scene2D graph in libgdx with several Group's and Actor's . You want the user to select some Actors and draw those at the end so they appear focussed on top of any other Actors . I would like to iterate over the Stage twice. The first time it draws the unselected Actors , the second time it draws the selected actors . I don't see any 'good' way to enforce this behaviour however. I would prefer options that are clean. I would not like to copy an entire method implementation just for the sake of this small addition. What doesn't work: the Actor's toFront () method only

libgdx touchDown called just once

£可爱£侵袭症+ 提交于 2019-12-04 03:47:41
问题 I'm new to LibGdx, and have problem with input handling. My player needs to shoot bullets whenever touch is down. But it seems that this method is called just once... And then user have to click again to shoot another bullet. I want always to shoot bullets while click is down... Is there a way to handle this use case? 回答1: Look into "polling" on the touch input, instead of getting Input events. So, in your render or update method, use something like this: boolean activeTouch = false; if (Gdx

how to use the libgdx contactlistener

别说谁变了你拦得住时间么 提交于 2019-12-04 03:39:00
I've just began to work with the Libgdx's Box2d Engine but i simply do not understand when the methods of the Contactlistener should be called. There is on the one hand "begin contact" and on the other "end contact". Where should i call them, to get the Number of of a certain fixture touching others? And how do I implement the Contactlistener ? A redirec' to a Tutorial would answer my Question. I didn't find anything while searching google. This one helped me a lot but it is written for C++ and does not refer to the implementation into a main-gamecircle. Thx for helping me ;) Here's a short

Understand LibGDX Coordinate system and drawing sprites

狂风中的少年 提交于 2019-12-04 03:03:31
问题 So I am super stoked to start using LibGDX for my first android title for OUYA and PC, but I am running into some snags with LibGDX. (All of my questions can be answered by looking at source, but I am really trying to understand the design choices as well). To start with, the coordinate system. I created a project using the Project Setup jar, and it creates an OrthographicCamera like so camera = new OrthographicCamera(1, h/w); From my reading, I understand that LibGdx uses bottom left corner

Exporting A Libgdx Game as Executable Jar from Android Studio

只愿长相守 提交于 2019-12-04 02:58:58
Okay so I made a game using Libgdx and I intended it to be a android app(which is why i use android studio) but I want to let my friend without android phones try it out. The project is already setup for both desktop and android so is there any way to export this as a executable jar file? TomGrill Games Type the command below in the terminal. Remember that you have to be in your LibGDX root directory, before issuing this command. gradlew desktop:dist More at: https://github.com/libgdx/libgdx/wiki/Gradle-on-the-Commandline#packaging-for-the-desktop You have to type gradlew desktop:dist command

libgdx draw chinese characters

主宰稳场 提交于 2019-12-04 02:46:22
I like to print Chinese text in my application. 1.When I try this, the screen will be empty. There is no error at the console. Create method: FreeTypeFontGenerator gen = new FreeTypeFontGenerator(Gdx.files.internal("fonts/DFLS1B.TTF")); font = gen.generateFont(40, "好", false); Render method: spriteBatch.setColor(1, 1, 1, 1); spriteBatch.begin(); font.draw(spriteBatch, "好", 10, 100); spriteBatch.end(); 2.When I try this, 3 different Chinese characters show up on screen but I have no idea why these characters where draw. There is no connection between asd and the three characters Create method:

In libgdx how do you attach a circleshape on top of a rectangle?

末鹿安然 提交于 2019-12-04 02:35:33
问题 I have created a body and I have created two separate fixtures, one fixture creates a rectangle shape and the other fixture creates a circle shape. But when I use the .createfixture it puts the circle in the centre of the rectangle, I want the circle on top of the rectangle like a matchstick. here is my code don't know what to do ... rectangleBodyDef = new BodyDef(); rectangleBodyDef.type = BodyType.DynamicBody; rectangleBodyDef.position.set(10,20); rectangleBody = world.createBody