libgdx

how to setup a libGDX project via proxy

﹥>﹥吖頭↗ 提交于 2019-12-04 11:19:11
I am using the libgdx project creator ( gdx-setup.jar ) to setup a new project. However, I am using a proxy connection on my Windows machine to access the internet and the gdx-setup.jar isn't able to detect the settings, thus I cannot download the required jar files and generate any project. How and where do I change the java proxy settings so that I am able to achieve this? PS: I have already tried to edit the settings under Control Panel->Java->Network Settings but to no avail. From Gradle's manual: 12.3. Accessing the web via a proxy You may need to create a $HOME/.gradle/gradle.properties

When to use ShapeRenderer, Mesh + SpriteBatch, Box2D and Scene2D in Libgdx?

て烟熏妆下的殇ゞ 提交于 2019-12-04 11:06:59
问题 I'm new in Android Game Development and after I started with libgdx ShapeRenderer and did a little more search, I became confused if I started with the right foot. So, what I really would like to know is when should I use ShapeRenderer, Mesh + SpriteBatch, Box2D and Scene2D. 回答1: LibGDX has quite a lot of (mostly orthogonal) APIs for rendering. I'm still learning my way around many of them, but I can give an overview of the different parts. ShapeRenderer lets you quickly and easily put basic

Stenciling using OpenGl ES 2.0

假如想象 提交于 2019-12-04 11:04:25
I am trying to figure out a way to cut out a certain region of a background texture such that a certain custom pattern is not rendered on the screen for that background. For example: This square can be any pattern. I am using Frame Buffer Object and Stencil Buffer to achieve this kind of effect. Here is the code: fbo.begin(); //Disables ColorMask and DepthMask so that all the rendering is done on the Stencil Buffer Gdx.gl20.glColorMask(false, false, false, false); Gdx.gl20.glDepthMask(false); Gdx.gl20.glEnable(GL20.GL_STENCIL_TEST); Gdx.gl20.glStencilFunc(GL20.GL_ALWAYS, 1, 0xFFFFFFFF); Gdx

scene2d button scaling with libgdx

孤街醉人 提交于 2019-12-04 09:56:31
I don't know if it is just me, but drawables confuse me. Are they intended to keep the size they are given, or is there a way to scale the image within them? I understand they can use ninepatch to fill certain areas by stretching an image, but I want to scale the image that it stretches. I am using a TextButton for my menu buttons, but they are way too big, and I would love to know how to scale them. I am retrieving the skin from an atlas, which has ninepatch images in it. Here is the settings screen: Here are the images in the pack I am using: Here is the initialization of the TextureAtlas,

How can I rotate Rectangles in Libgdx?

我们两清 提交于 2019-12-04 09:36:07
问题 I rotated my sprite 90 degrees and I want to do the same with my rectangle to be able to use them for collision, but the rotate() method is not available on rectangles. This is what I did: treeSpr=new Sprite(new Texture(Gdx.files.internal("tree.png"))); treeSpr.setPosition(250,700); treeSpr.rotate(90f); //Rectangle treeRect=new Rectangle(treeSpr.getX(),treeSpr.getHeight(), treeSpr.getWidth(),treeSpr.getHeight()); 回答1: The other answer is basically correct; however, I had some issues with the

LibGDX RTL font rendering?

大城市里の小女人 提交于 2019-12-04 09:28:37
I am creating an application that should support two languages, English, and Hebrew. The problem is that Hebrew is Right-To-Left western language and English is Left-To-Right language, and LibGDX does not support RTL fonts. I have created the bitmap for the font and everything works But when I write in hebrew, it will write the words reversed. I have a solution for this when I write solely in hebrew, just reverse the words using a StringBuilder , but that's a cheap-fix. But what if I want to implemnet a chat, or character name? Yvette Colomb From what I can see the easiest solution is to use

Get cursor position in LIBGDX

末鹿安然 提交于 2019-12-04 09:22:07
问题 How to get cursor position in libgdx and apply it to sprite? Like this? I want my sprite to have the direction pointed wherever my cursor is in the screen.I search libgdx examples but i cant find any examples related to that. 回答1: Get cursor position If you're polling for input, use Gdx.input.getX() and Gdx.input.getY() to get the current mouse x and y coordinates. (The doc says its only relevant for touch, but the code looks like it reports raw mouse values regardless of button state.) If

libGDX Google Play Game Services - Android

China☆狼群 提交于 2019-12-04 08:24:28
I am trying to implement Google play Game Services into libGDX project. In my android project, the MainActivity looks like this: public class MainActivity extends AndroidApplication implements GameHelper.GameHelperListener, ActionResolver { GameHelper gameHelper; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); gameHelper = new GameHelper(this, GameHelper.CLIENT_ALL); gameHelper.enableDebugLog(true); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);

Libgdx first person camera controll

…衆ロ難τιáo~ 提交于 2019-12-04 07:53:17
I just started playing arround with 3D in libgdx. I allready know how to draw basic Model s and i tryed to play arround with the CameraController . Now i want to create a FirstPersonCamera or FirstPersonCameraController . I thought about extending PerspectiveCamera and adding a MyMovingObject target to it. The MyMovingObject would hold a x, y, z position , where y is a constant value, cause i can't move up/down at the moment. So my movement is basicly in 2D. The MyMovingObject would also store the left/right rotation , needed for its moving direction / xSpeed, zSpeed . But the Player should

What is a Delta time in LIBGDX

北城余情 提交于 2019-12-04 06:54:00
What is a Delta time in LIBGDX? I read many posts regarding that. To my knowledge, Delta time is, The time gap between previous and current frame delta time will add upto 1 since its the computation of x frames per second ie.(1/x of the frames) To make the speed constant for the game we use dt If we say 60 *dt then it will move 60 frames per second, no matter what the speed of the mobile(for instance) is. So, this is what I know about delta time but I am not getting a clear view about it because , be it for an update or render method we are passing the delta time but where in the code we are