libgdx

LibGDX assigning a specific shader to a ModelInstance

不问归期 提交于 2019-12-06 08:11:49
I have recently been learning an implementing my own shaders in libgdx. So far I did this with a custom shader provider, which chooses between a few shaders based on the userdata value of the object; public class MyShaderProvider extends DefaultShaderProvider { public final DefaultShader.Config config; final static String logstag = "ME.MyShaderProvider"; //known shaders static public enum shadertypes { prettynoise, invert, standardlibgdx, noise, distancefield, conceptbeam } public MyShaderProvider (final DefaultShader.Config config) { this.config = (config == null) ? new DefaultShader.Config()

why dont i have universal tween engine when setting up LibGDX

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 07:40:31
问题 Following a tutorial on setting up A LibGDX project and the tutorial says that in the third party section there should be a Universal Tween Engine. Mines not showing up, is there a way for it to show up? What do i have to download? Thanks in advance :)) 回答1: The Gdx-setup-new-ui-jar does not come with TweenEngine library. There is another way of adding Universal TweenEngine. Since you are using Gradle now, so it is very easy. just download the TweenEngine from here https://code.google.com/p

LibGDX/Box2D UnsatisfiedLinkError

空扰寡人 提交于 2019-12-06 07:24:11
I'm using the EXACT same code as used in this tutorial but for some reason I get an error while trying to run the project. The default project for LibGDX worked fine. Error: Exception in thread "main" java.lang.UnsatisfiedLinkError: com.badlogic.gdx.physics.box2d.World.newWorld(FFZ)J at com.badlogic.gdx.physics.box2d.World.newWorld(Native Method) at com.badlogic.gdx.physics.box2d.World.<init>(World.java:222) at net.ocps.tchs.permarun.PermaRun.<init>(PermaRun.java:19) at net.ocps.tchs.permarun.Main.main(Main.java:14) Line it is referring to(the first line in the class): World world = new World

Supporting Multiple image resolution for libgdx

…衆ロ難τιáo~ 提交于 2019-12-06 07:19:04
How should I follow the directory structure and what to specify so that assetManger will use that folder for different resolution. I have studied assetManager and ResolutionFileResolver but until now I couldn't exactly figured how to specify the folder to support different resolutions. Update : Newer versions of Libgdx use a different strategy to resolve filenames (with directories, not files), so this answer does not apply to newer Libgdx versions after (0.9.2, I think? https://github.com/libgdx/libgdx/commit/3afcfe49c40196765033a90b4610159183dde981 ) The built-in ResolutionFileResolver does

Generating textures at runtime with text using libgdx

▼魔方 西西 提交于 2019-12-06 07:10:50
问题 I'm working on a phone word game. Yesterday I decided to switch to OpenGL using libgdx to try and improve graphics performance and battery usage + to target more platforms. The way letter tile drawing was working on a 2D canvas was each letter tile would create a bitmap for itself. I would: Create a new mutable bitmap from the background bitmap. Draw on the letter on the new bitmap. Apply other tile specific effects. Draw the new bitmap for each frame What's the best way for me to achieve

LibGDX Stencil Buffers while using SpriteBatch

浪尽此生 提交于 2019-12-06 06:20:46
This is a continuation of my previous problem and post, seen here . Thanks to the answer I received there I feel I was able to get a little closer to my goal, as well as further my learning of OpenGL, but shortly after figuring out the basics of working with stencil buffers, I've run into a problem. It seems that when I draw a sprite to the stencil buffer, it draws the entire square area, rather than just the pixels that aren't fully transparent as I had ignorantly hoped. I vaguely understand why it happens that way, but I am not sure where the solution lies. I have experimented with the

LibGDX - Drawing to a FrameBuffer does not work

孤街浪徒 提交于 2019-12-06 06:09:46
So I'm trying to make custom buttons, for which I need to combine different parts of the button background. To do this I figured using a FrameBuffer would work, however it did not give viable results. Therefore I attempted to test my FrameBuffer drawing method, by writing a simple test method, which returns a texture that is drawn to the display at every render() call. This method is here (note that it is a test method, so it may be a little poorly optimized): private Texture test() { BitmapFont f = ReverseBlade.fontTitle; f.setColor(Color.LIGHT_GRAY); FrameBuffer fbo = new FrameBuffer(Format

Image asset protection/encryption in an Android app

情到浓时终转凉″ 提交于 2019-12-06 05:55:11
I have created an Android game where I use TextureAtlas generated from the TexturePacker tool. I have paid an artist to create good quality assets. So I have these nice large png files with alpha, containing all the assets, waiting to be stolen by anybody unzipping my apk. And I would like to protect them - at least a little - from hackers and thieves. I have searched and found nothing except the usual "you will NEVER be able to fully protect your app" or "only thing you can do is to create you own cipher and encryption system from scratch by yourself" (yes, I am exaggerating a little here). I

LibGDX FreeTypeFontGenerator NoSuchField exception

↘锁芯ラ 提交于 2019-12-06 05:49:17
Right now, I'm building a small game with LibGDX in Java, and I want to use a TTF font. I've added gdx-freetype.jar and gdx-freetype-natives.jar to my build paths, but when I get to running my application, I get a "java.lang.NoSuchFieldError: id" error. The code responsible: FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("data/Prosto.ttf")); BitmapFont font = generator.generateFont(12); generator.dispose(); I read somewhere it might have something to do with the versions of the JARs. I've tried running the setup UI again, I've tried JARs from another version,

iOS game localization with lproj directories not working

那年仲夏 提交于 2019-12-06 05:21:02
My game is localized in 3 different languages. In order to let iTunes Connect know that the game is localized I created these files: ios\resources\en.lproj\Localizable.strings ios\resources\es.lproj\Localizable.strings ios\resources\ca.lproj\Localizable.strings all three with this content: "AppName"="MechaNika" being MechaNika the name of my game. However, after creating the IPA file and uploading it to iTunes Connect with the Application Loader, it says that my game is only in English, so it seems that I'm missing something. Note that I'm not using Xcode but libGDX + IntelliJ IDEA + gradle +