Jump to content

Libgdx POT issue


aspiretocode

Recommended Posts

Hi all, thanks for Spriter, it's amazing! Trying to get it working on Libgdx and it's giving me power of two errors. I've looked at the code on Github by Trixtor and used parts of it to implement, also it looked like his asset files weren't in a textureAtlas or anything, but not sure how to get around the POT issue, also would like my images to be in an Atlas when i figure out how to use this thang.

Thanks for any help.

Link to comment
Share on other sites

POT issue?

Also, to use texture atlases, just make sure your atlas file retains the original file paths, so you can find an individual image based off the file information the way it's save in scml. There have been a few implementations that use atlases this way,

ie. instead of finding the image "arms/hand.png" as the file hand.png, in the subfolder arms/

find the image in the atlas referred to as "arms/hand.png"

Link to comment
Share on other sites

Unless I'm mistaken, it's just a configuration problem. In libgdx, you'll need to find your entry code (desktop and android have their own) and it may look similar to:


public class Main
{
public static void main( String[] args )
{
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.title = "My App";
config.useGL20 = true;
new LwjglApplication( new App(), config );
}
}

In a GL10 configuration, your textures must be power of two (if the useGL20 option is set to false, libgdx defaults to GL10). You'll want it to be set to true to avoid these errors, as GL20 can handle non-POT textures.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...