libgdx

Texture from texturepacker in LibGDX

淺唱寂寞╮ 提交于 2019-12-09 06:44:57
问题 Trying get my head around the texture wrapper in (the awesome) LibGDX framework and I need help. I would like to bind a texture (according to Mesh, Color & Texture) that is extracted from a TextureAtlas packed with the TexturePacker. The texture is binding to a rectangular mesh. I want the texture (instance of Texture) to basically be extracted from a packed file. Is it doable to use a the createsprite or findregion methods and somehow skip the filehandle step? Additionally: Anything special

Understanding 3D Models and Nodes in Libgdx

…衆ロ難τιáo~ 提交于 2019-12-09 04:54:26
I am trying to get a better understanding of the Model s and their Node hierarchy in Libgdx . As much as i understood, a Model is made of many Child Node s, which can contain other Node s as well. Each node has a Vector3 translation describing its position, Vector3 scale , describing its scale and Quaternion rotation describing its rotation, all relative to the parent Node or Model . The Matrix4 gloabalTransform describes the same, but relative to the world they are in. Now if i think about games like Garrys Mod , where the Model s of the Player s can move parts of the model dynamically (for

how to drag and drop actors on libgdx scene2d?

孤人 提交于 2019-12-09 04:20:31
问题 I'm developing a game using libGDX and I would like to know how I can drag and drop an Actor. I've made my stage and drawn the actor, but I don't know how to trigger that event. Please try to help me using my own architecture. public class MyGame implements ApplicationListener { Stage stage; Texture texture; Image actor; @Override public void create() { texture = new Texture(Gdx.files.internal("actor.png")); Gdx.input.setInputProcessor(stage); stage = new Stage(512f,512f,true); actor = new

Implementing trapezoidal sprites in LibGDX

懵懂的女人 提交于 2019-12-09 01:50:30
问题 I'm trying to create a procedural animation engine for a simple 2D game, that would let me create nice looking animations out of a small number of images (similar to this approach, but for 2D: http://www.gdcvault.com/play/1020583/Animation-Bootcamp-An-Indie-Approach) At the moment I have keyframes which hold data for different animation objects, the keyframes are arrays of floats representing the following: translateX, translateY, scaleX, scaleY, rotation (degrees) I'd like to add skewX,

Headless/CLI LibGDX

谁说胖子不能爱 提交于 2019-12-08 23:50:13
问题 I'm coding the server-side for a small LibGDX powered game, and have stumbled across an issue. Every time I try and use any Gdx.files.* methods, I'm met with a NullPointerException . Apparently this is because I'm not implementing the ApplicationListener, so LibGDX has not been initialized. Is there any way of initializing LibGDX in a headless/CLI way? I need to be able to load TiledMap objects on the server-side. MapLoader(Request request) { TiledMap tmp = new TmxMapLoader().load("maps/" +

OpenGL 2.0 or higher with the FBO extension is required- LibGDX Error

岁酱吖の 提交于 2019-12-08 20:18:15
问题 I start using LibGDX from a month ago & It was working perfectly! But yesterday, after updating to Java 8, I ran two desktop projects that used to work , it showed me this error: OpenGL is not supported by the video driver I searched online & I found someone post this code: System.setProperty("org.lwjgl.opengl.Display.allowSoftwareOpenGL", "true"); Well, it works with one of the project, zombie bird tutorial that I was studying , but with the other project It shows: OpenGL 2.0 or higher with

Libgdx FreeTypeFontGenerator with AssetManager

倾然丶 夕夏残阳落幕 提交于 2019-12-08 19:15:59
问题 i'd like to use the asset manager in combination with the FreeTypeFontGenerator. I dont want to load fnt files cause they display differently on different screenresolutions. So what i do currently is generating my fonts on the fly in every actor or screen. Now i think its best to generate the fonts once when the game is started and load them into the asset manager. But the AssetManager seems to need a filename with the BitmapFont.class parameter. What i want to do is generate 5 different

Libgdx save SpriteBatch in a texture

邮差的信 提交于 2019-12-08 19:13:28
I would like to know if it possible to save a spriteBatch in a texture . SpriteBatch batch = new SpriteBatch(); After drawing a few thing inside the batch , I would like to save all thing that contains the SpriteBatch in One texture (something like a screenshot ). I have no idea to how to do it, I searched on the web and on the libgdx doc but didn't found. Thanks you You can render to a FrameBufferObject (FBO). See https://github.com/mattdesl/lwjgl-basics/wiki/FrameBufferObjects An FBO will work if you are okay with making the decision to render to a texture in advance. One side-effect is that

libGDX - How to clip

时光总嘲笑我的痴心妄想 提交于 2019-12-08 17:28:04
问题 I have one SpriteBatch in my game, between whose batch.begin() and batch.end() I draw... a large static background image several game sprites I want to clip the area in which the sprites are seen, which I've read is done using ScissorStack . The problem is that ScissorStack appears to clip the entire SpriteBatch that's sent to the GPU. The result is that it clips my game sprites and the background image. Question: Must I have two separate batch.begin() and batch.end() cycles, one without

How do I make a ProgressBar work in LibGDX?

自古美人都是妖i 提交于 2019-12-08 16:47:18
问题 I'm trying to understand how to use a ProgressBar in LibGDX. I have created the bar but I don't know how to make it works. I want to duplicate the knob in order to fill the bar(background line) in 60 seconds. I know how to manage about the time, but there is no method in ProgressBar's class to fill the bar with the knob. At least, I haven't seen it (or I don't understand how, possibly). Here is my code: ProgressBar's code: skin = new Skin(); Pixmap pixmap = new Pixmap(10, 10, Format.RGBA8888)