Jump to content

Generic Java Importer


Discobeard
 Share

Recommended Posts

I was trying to implement interpolation but for some reason the position during interpolation is all screwed up, see image: weird_position.jpg

I have the exact same bone structure in all animations and I have exactly the same sprite objects attached to those bones. I have tried to tweak a lot in spriter but i can't figure out what i'm doing wrong? Do you have any idea, if needed I can send over the spriter file.

Link to comment
Share on other sites

I was trying to implement interpolation but for some reason the position during interpolation is all screwed up[...]

OMFG?!! Are you using the newest version? This is definitely not your fault. It is mine.

Please, send me the scml file (it can contain only the bone structure, if you want to keep your sprites private). Since I implemented curves, things in the SpriterPlayerInterpolator class went wrong and I only tested it with the monster scml file.

Could you add that to the github project? By default, github projects are licensed as all rights reserved without an explicit license.
Added.

Update:

The library is now able to load points and boxes, but there are missing useful methods for you guys, like collision queries.

Drawing them is only possible via the debugDraw method (so before debugDrawing objects, you need to call "player.calcBoundingBox(null)").

Object infos are also getting loaded now and bones are rendered properly.

I also discovered some new bugs today while testing the SpriterAnimationArtPack. I hope I can fix them as far as possible.

Roadmap:

After fixing those bugs and adding some more useful features, like animation listeners, I will begin to refactor many things, cause I really don't like the structure.

I hope this won't be a big impact on your current projects.

After this, I will try to add skinning support. I think skinning is more important than sounds for now (sound support is just another reference mapping and could also be used now,

with some clever directory structure and a modification of the frontend loader class (when loading a file just check the file type)).

-Trixt0r

Link to comment
Share on other sites

I was trying to implement interpolation but for some reason the position during interpolation is all screwed up[...]

OMFG?!! Are you using the newest version? This is definitely not your fault. It is mine.

Please, send me the scml file (it can contain only the bone structure, if you want to keep your sprites private). Since I implemented curves, things in the SpriterPlayerInterpolator class went wrong and I only tested it with the monster scml file.

-Trixt0r

I'm using the latest version and I have send you the link to the file via ICQ.

Link to comment
Share on other sites

Big Update:

During the last weekend I refactored/rewrote the whole library.

This means that your old code will not work anymore. All old classes are completely gone. I hope this does not affect any important projects you are working on currently (well it breaks some of my private projects, but it does not matter).

I really did not like the old code, because there was reduntant code and the classes were not readable anymore. Now every class has not more than 300 lines of code (except the XmlReader which is not mine) and there are less classes. With the refactoring I fixed many bugs and I think that now any Spriter animation should be rendered properly.

The basic usage is now the following:


//During initialization
Data data = new SCMLReader("Path to scml file").getSpriterData(); //Parse the scml file and receive usable data
Loader<?> loader = new YourLoaderImplementation(data); //The loader relies on the loaded data
loader.load("parent folder of scml file");//Load the resources
Drawer<?> drawer = new YourDrawerImplementation(loader);
Player player = new Player(data.getEntity("yourEntity")); //Or use the index

//During updating and rendering
player.update();
drawer.draw(player);

All old features are still working, but the way you apply them is a little bit different.

I rewrote all backend tests and dropped the SpriterDemo project.

I am planning to add more tests based on the libgdx backend, so everyone can checkout a specific feature instead of just running a full blown demo.

Documentation is missing, but it will follow as soon as possible.

Edit: Added now an example for Java2D inside a Swing application and some basic tests. More will follow this week.

- Trixt0r

Link to comment
Share on other sites

  • 2 weeks later...

Back after two weeks vacation from programming XD;

Dear Trixt0r, First of all : I can't express how much i'm happy with this new amazing Library :) it took me sometime to reconstruct my current project to work with it , but it was totally worth it ^^ (And yes , the new loading is amazing XD, noticed at least 50% improvement in terms of speed while loading my SCML file to my android, espcially since spriterplayer class is gone).

The new Test hierarchy is brilliant , i used to get lost very easily in the Demo one XD 10/10

really appreciate your hard work, thx again ^^

PS: it is lil late but thx for the Bounding box update , Love it!

Link to comment
Share on other sites

  • 2 weeks later...

The library is really awesome.

With the newest version from github i get a strange bug when i flip the player. Without flipping everything is normal, but as soon as i flipX the player, the positions of the images are messed up. The drawing of the bones is upsidedown, but the animation is fine.

I guess i forgot something, but i also didnt get your test working when i flip the player with flipX().

I'm using Slick2d, but i also tested the Java2d tests, there the bones are always correct, just the images are not in position.

I hope someone can help me and thank you very much.

post-17035-14159834200795_thumb.png

Link to comment
Share on other sites

Hey guys,

I added a new feature to the library: Attachments.

The idea behind attachments is that you could attach any 2D object to a specific part of a running animation. For example you could add a particle effect in your game to a sorcerer hand or something like that. You can see how it works in the AttachmentTest. I hope this is a useful thing for you guys.

As the state of the library seems to be quite bug free, I am currently planning to complete all remaining features, such as meta data and skinning and maybe the new SCML features coming with the B8 release.

Btw, is someone interested in a JavaFX rendering example?

If you are in the need for any other new features let me know it.

-Trixt0r

Link to comment
Share on other sites

Greengnom : i also had trouble with the flip x and Y method messing my animation , but i solved this by creating two methods that fixes the flip and x from :


public void flipX() {

this.root.scale.x *= -1;
}

public void flipY() {
this.root.scale.y *= -1;
}

to :



public void setDirectionLeft() {
if (this.root.scale.x > 0)
this.root.scale.x *= -1;

}

public void setDirectionRight() {
if (this.root.scale.x < 0)
this.root.scale.x *= -1;

}

which i use to set the direction manually for my sprites coz I did not know how to implment flipx and y properly.

-Trixt0r: very nice feature from the sounds of it , I did not implement and particles yet in my project yet but when i do in the future, i'll give it for sure a go ^^ thx again for your hard work~

Link to comment
Share on other sites

Hi guyz.

Trixt0r! you are make an excellent work! :D

I have a little problem with your loader tool. When I try run your test project with Eclipse it says me

Couldn't load shared library 'gdx64.dll' for target: Windows 7, 64-bit
. I dont know why. Im still learning LigGDX but I dont think than I did something wrong. I really like to run Spriters animations in libGDX.
Link to comment
Share on other sites

boind: I did not get the problem? The Player class has already methods to flip the animation and to check whether it is flipped or not:


//Flipping:
player.flipX();
player.flipY();
//Or
player.flip(true, true);

//And to check whether the player is flipped:
if(player.flippedX() == -1)//If flipped around x axis
if(player.flippedX() == 1) //If not flipped around x axis
//Same for y axis

This enables the ability to write code a little bit more elegant.

Let's say you have two methods called right() and left(), indicating that the right resp. the left button of your controller are pressed.

Then you could change the flipping around the x axis with this line:


player.flip((player.flippedX() == -1 && right()) || (player.flippedX() == 1 && left()) , false);

Or for more readability you could create a method which tells whether to flip or not:


private boolean flipPlayer(){
return (player.flippedX() == -1 && right()) || (player.flippedX() == 1 && left());
}
//In your loop:
player.flip(flipPlayer(), false);

The reason why flippedX() and flippedY() return an integer instead of a boolean, is that it removes boilerplate code.

Let's say you have a character which moves like this

character.position.x += speed;

If the methods would return a boolean you would first check with an if/else construction the face direction and then you would move the character:


if(player.flippedX())
character.position.x -= speed;
else
character.position.x += speed;

Because the methods return integers you can avoid the condition checking and set the position like this:

character.position.x += speed*player.flippedX();

Instead of 4 lines you have only one.

That is the way I would write a game, because I really do not like writing much code for simple things.

Btw, the flipping issue greengnom mentioned is already fixed.

I recommend you guys update your cloned repository more often, in the last few days I made some additions and changes.

Forgot to mention: The library works also with GWT now.

- Trixt0r

Link to comment
Share on other sites

Hi Trixt0r.

First of all thanks for your amazing work with Spriter importer. :D

I have little problem with spriter importer. I try run your test project with eclipse and it says me this

Couldn't load shared library 'gdx64.dll' for target: Windows 7, 64-bit
. I dont know why and what Im doing wrong.
Link to comment
Share on other sites

Oh sorry, I did not see the first post.

You have to add the gdx.jar and gdx-natives to your classpath. In eclipse it is under Project->Properties->Java Build Path.

There you should make shure that the library gets exported.

Maybe you should ask in the LibGDX forums, because the problem has nothing to do with the Spriter library.

- Trixt0r

Link to comment
Share on other sites

Nice work, Trixtor.

The Good: Looking good after refactor, and quite easy to use.

The Not so Good: A cursory test on Android reveals the garbage collector is constantly kicking in, causing stuttering. The liberal use of iterators (ugh) in the library is leaving a quite a bit of memory (tracked in DDMS) out to hang every frame on 6-8 concurrent animations, regularly collecting ~512k. Not acceptable for any serious project :) Easy to remedy, if you wish to be friendly to the Android platform.

Link to comment
Share on other sites

Is it really that bad on android?

I heard from other people that they get a sufficient performance on their devices.

Well, I think I should remove the whole internal Java collection stuff, maybe this will remove some GC operations.

Thanks for the hint.

-Trixt0r

Link to comment
Share on other sites

dear Trixt0r,

first of all , wow XD u combined my 20+ lines of coding into a single line lol , just blew my mind

character.position.x += speed*player.flippedX();

hopefully someday i'll be able to think like that , I actually started programing real late in life..... but lets leave the excuses for the lazy ppl XD back to programming back to programming lol

and yup now i got it , thx for clarifiying it for me ^^ always appreciate it when you give me some of your time

btw ,I just want to second TFS note on the cons specifically in the part :

 in the library is leaving a quite a bit of memory (tracked in DDMS) out to hang every frame on 6-8 concurrent animations

In the proj that i keep going back and forth in , "3" Spriters files takes up to 45~49MB of RAM when "initiated" (75MB including other resources).

the hero scml file takes up at least 30MB of RAM when it is created ,BUT, after leaving the proj running for a while(2~3mins) i came back to find proj occupies 5~7 of ram only which i believe after system.gc() kicks in by itself and does it thing. if there is a way to reach that goal immediately it will be brilliant, coz when i try to create 7~8 spriters the app crashes due to the huge data occupied in RAM.

dunno if that info was helpful or not , but i thought i might as well share it since we r on the topic ^^;

Link to comment
Share on other sites

Is it really that bad on android?

I heard from other people that they get a sufficient performance on their devices.

In a game loop, anything that give the GC something to do needs re-thinking :)

Performance is not the problem, but the GC kicks it in the balls when it is invoked. It's more a separate technical issue - and I tested on Nexus 7s, not exactly weak devices. That's also a reason why libGDX provides its own implementation of collections, it hangs on to its iterator so it doesn't get GC'd. There are some limitations to it, but it works well. Personally, I avoid iterators altogether. Of course, in dropping them you'll trade a little elegance but the end result is what matters.

Link to comment
Share on other sites

In the proj that i keep going back and forth in , "3" Spriters files takes up to 45~49MB of RAM when "initiated" (75MB including other resources).

the hero scml file takes up at least 30MB of RAM when it is created ,BUT, after leaving the proj running for a while(2~3mins) i came back to find proj occupies 5~7 of ram only which i believe after system.gc() kicks in by itself and does it thing. if there is a way to reach that goal immediately it will be brilliant, coz when i try to create 7~8 spriters the app crashes due to the huge data occupied in RAM.

Hrm... That seems a bit excessive, but I haven't profiled multiple Spriter files yet.

It would be nice if Spriter had a built in option to strip out all the useless whitespace in either of its xml/json formats, we could then use slightly smaller buffers and it would be faster to parse. So, one experiment would be to strip it yourself beforehand. I'm going to assume the xml parser will be able to manage it. JSON would be a bit better, but Spriter's JSON (SCON) format seemed a bit off to me compared to all the JSON I'm used to seeing, and someone would have to add a parser/loader but that's not a huge deal... Also, are you Atlasing your textures on the fly? (this is not ideal) There's probably an impact there that needs examining.

Link to comment
Share on other sites

it hangs on to its iterator so it doesn't get GC'd
I am doing this too in the Player class for objects and bones.
Personally, I avoid iterators altogether. Of course, in dropping them you'll trade a little elegance but the end result is what matters.
I also do not like iterators, but using them simplifies the interface for drawing. The drawer takes an iterator and draws everything it offers. This makes it easier for you to control what you want to draw (see CullingTest).
It would be nice if Spriter had a built in option to strip out all the useless whitespace in either of its xml/json formats, we could then use slightly smaller buffers and it would be faster to parse. So, one experiment would be to strip it yourself beforehand. I'm going to assume the xml parser will be able to manage it.
Sounds interesting. The xml parser is able to do this, since it is the one from LibGDX ^^.
Also, are you Atlasing your textures on the fly? (this is not ideal) There's probably an impact there that needs examining.
Yes, atlases can be generated after parsing and loading all textures. Mabe this will not be necessary anymore in the future because atlas support was planned for Spriter. Maybe it will come with the next build?

In terms of drawing performance, there could be improved the texture sampling (avoid sampling transparent pixels). But this depends on the evolution of the skinning feature in Spriter. For now this feature is quite buggy and as I read here in the forums not many people are using it, and if they use it, they are exporting their animations to sheets. So I may wait for the skinning implementation. It makes no sense to implement it if the format for skinning may change in the future. Furthermore, the way Spriter is saving skins in SCML is very confusing without having a documentation. And maybe skinning should be more similar to the Spine implementation, which is very flexible compared to the current Spriter version (just a suggestion :)).

If you guys can improve the library, fork the repo and send me a pull request and I will merge the improved stuff into it.

- Trixt0r

Link to comment
Share on other sites

  • 2 weeks later...

Hi Trixt0r :).

I have a little problem that spriter animation is working for me only on PC and on Android not.

Im making project with libGDX for Desktop and Android. Just these two. Now I put source code from your Spriter Test project to my core project and spriter (.scml) files put to assets folder. Assets folder is linked together so it have to work. But it doesnt work.

When I run Desktop project it says me than it cant find those .scml files.

It only works when I create some folder myself in Desktop project folder and there I put those .scml files. Now when I run desktop project it works perfectly.

So problem is that it cant load .scml files from assets folder libGDX project. And I need this folder because Im making games for android not PC. So when I run Android project on my android device it says error about loading .scml files.

Please have you try make libGDX project and run it with android device? Because I and my friend who also working with libGDX has the same problem.

Source code of my test project is the same as yours from your testSpriterProject for libGDX.

Im making project with libGDX Gradle based setup application.

So it only works and only for PC when I create myself some folder in Desktop project. In assets it doesnt.

Here is console log from eclipse when I put .scml files to assets and run Desktop project:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: File not found: assets\coin\coins.scml (Internal)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:134)
at com.mygdx.game.MyGdxGame.create(MyGdxGame.java:34)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:136)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)

Here is source code of core project file:

package com.mygdx.game;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.brashmonkey.spriter.Drawer;
import com.brashmonkey.spriter.Player;
import com.brashmonkey.spriter.SCMLReader;
import com.brashmonkey.spriter.Data;
import com.mygdx.game.spriter.LibGdxDrawer;
import com.mygdx.game.spriter.LibGdxLoader;

public class MyGdxGame implements ApplicationListener {

Player player;
ShapeRenderer renderer;
SpriteBatch batch;
Drawer drawer;
LibGdxLoader loader;
OrthographicCamera cam;

@Override
public void create() {
cam = new OrthographicCamera();
cam.zoom = 1f;
renderer = new ShapeRenderer();
batch = new SpriteBatch();
FileHandle handle = Gdx.files.internal("assets/coin/coins.scml");
Data data = new SCMLReader(handle.read()).getData();

loader = new LibGdxLoader(data);
loader.load(handle.file());

drawer = new LibGdxDrawer(loader, batch, renderer);

player = new Player(data.getEntity(0));
}

@Override
public void resize(int width, int height) {
cam.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
cam.position.set(0, 0, 0f);
cam.update();
renderer.setProjectionMatrix(cam.combined);
batch.setProjectionMatrix(cam.combined);
}

@Override
public void render() {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

player.update();

batch.begin();
drawer.draw(player);
batch.end();

}

@Override
public void pause() {
}

@Override
public void resume() {
}

@Override
public void dispose() {
renderer.dispose();
loader.dispose();
}
}

Here is source code of Desktop project file:

package com.mygdx.game.desktop;

import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.mygdx.game.MyGdxGame;

public class DesktopLauncher {
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();

config.title = "Spriter test";
config.width = 800;
config.height = 640;

new LwjglApplication(new MyGdxGame(), config);
}
}

Here is log info from android project:

05-13 19:19:54.402: W/dalvikvm(17534): threadid=11: thread exiting with uncaught exception (group=0x4114f2a0)
05-13 19:19:54.422: E/AndroidRuntime(17534): FATAL EXCEPTION: GLThread 5456
05-13 19:19:54.422: E/AndroidRuntime(17534): com.badlogic.gdx.utils.GdxRuntimeException: Error reading file: assets/coin/coins.scml (Internal)
05-13 19:19:54.422: E/AndroidRuntime(17534): at com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:75)
05-13 19:19:54.422: E/AndroidRuntime(17534): at com.mygdx.game.MyGdxGame.create(MyGdxGame.java:34)
05-13 19:19:54.422: E/AndroidRuntime(17534): at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:236)
05-13 19:19:54.422: E/AndroidRuntime(17534): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1511)
05-13 19:19:54.422: E/AndroidRuntime(17534): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
05-13 19:19:54.422: E/AndroidRuntime(17534): Caused by: java.io.FileNotFoundException: assets/coin/coins.scml
05-13 19:19:54.422: E/AndroidRuntime(17534): at android.content.res.AssetManager.openAsset(Native Method)
05-13 19:19:54.422: E/AndroidRuntime(17534): at android.content.res.AssetManager.open(AssetManager.java:315)
05-13 19:19:54.422: E/AndroidRuntime(17534): at android.content.res.AssetManager.open(AssetManager.java:289)
05-13 19:19:54.422: E/AndroidRuntime(17534): at com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:73)
05-13 19:19:54.422: E/AndroidRuntime(17534): ... 4 more

Thank you very much for help :) . If you will need anything else tell me and I post it.

Link to comment
Share on other sites

Assets folder is linked together so it have to work. But it doesnt work.

When I run Desktop project it says me than it cant find those .scml files.

It only works when I create some folder myself in Desktop project folder and there I put those .scml files. Now when I run desktop project it works perfectly.

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: File not found: assets\coin\coins.scml (Internal)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:134)

I don't think you need the assets folder in your path.

Example: FileHandle handle = Gdx.files.internal("assets/coin/coins.scml");

Change to: FileHandle handle = Gdx.files.internal("coin/coins.scml");

I never point to "assets" because Gdx.files.internal already knows to look in the assets folder. With the code you have, it's like you are making it point to assets/assets/coin/coins.scml

Give that a try. Works for me. Also, on android it's possible you may need to edit the manifest file.

Link to comment
Share on other sites

Assets folder is linked together so it have to work. But it doesnt work.

When I run Desktop project it says me than it cant find those .scml files.

It only works when I create some folder myself in Desktop project folder and there I put those .scml files. Now when I run desktop project it works perfectly.

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: File not found: assets\coin\coins.scml (Internal)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:134)

I don't think you need the assets folder in your path.

Example: FileHandle handle = Gdx.files.internal("assets/coin/coins.scml");

Change to: FileHandle handle = Gdx.files.internal("coin/coins.scml");

I never point to "assets" because Gdx.files.internal already knows to look in the assets folder. With the code you have, it's like you are making it point to assets/assets/coin/coins.scml

Give that a try. Works for me. Also, on android it's possible you may need to edit the manifest file.

Hi JustinC.

Thank you for your responce :).

I try everything but it doesnt work neither. I try coin/coins.scml, assets/coin/coins.scml it only works if I make new folder in Desktop (not existing assets folder) project for example "abcdef/coin/coins.scml" and I point to it like that Gdx.files.internal("abcdef/coin/coins.scml"). If I do this it works fine. But only in desktop project. Android needs assets folder or some folder in android project with scml files. But doesnt work anything. My friend was trying catch errors from android and it seems than everything works fine with .scml file but it seems it doesnt load only first picture of animation set and for that it get a error. I really dont know how to make work for android.

So and you are making libGDX project with libGDX application setup tool or just yourself? Im making project with libGDX tool and I dont changing anything in project.

And here is error from try with coin/coins.scml. It seems it need to be assets/coin/coins.scml:

Desktop project:

Exception in thread "LWJGL Application" java.lang.NullPointerException
at com.mygdx.game.spriter.LibGdxDrawer.draw(LibGdxDrawer.java:44)
at com.brashmonkey.spriter.Drawer.draw(Drawer.java:201)
at com.brashmonkey.spriter.Drawer.draw(Drawer.java:188)
at com.brashmonkey.spriter.Drawer.draw(Drawer.java:179)
at com.mygdx.game.MyGdxGame.render(MyGdxGame.java:60)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:206)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)

Android project:

05-14 14:51:42.610: W/dalvikvm(26493): threadid=11: thread exiting with uncaught exception (group=0x4114f2a0)
05-14 14:51:42.620: E/AndroidRuntime(26493): FATAL EXCEPTION: GLThread 5750
05-14 14:51:42.620: E/AndroidRuntime(26493): java.lang.NullPointerException
05-14 14:51:42.620: E/AndroidRuntime(26493): at com.mygdx.game.spriter.LibGdxDrawer.draw(LibGdxDrawer.java:44)
05-14 14:51:42.620: E/AndroidRuntime(26493): at com.brashmonkey.spriter.Drawer.draw(Drawer.java:201)
05-14 14:51:42.620: E/AndroidRuntime(26493): at com.brashmonkey.spriter.Drawer.draw(Drawer.java:188)
05-14 14:51:42.620: E/AndroidRuntime(26493): at com.brashmonkey.spriter.Drawer.draw(Drawer.java:179)
05-14 14:51:42.620: E/AndroidRuntime(26493): at com.mygdx.game.MyGdxGame.render(MyGdxGame.java:60)
05-14 14:51:42.620: E/AndroidRuntime(26493): at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:414)
05-14 14:51:42.620: E/AndroidRuntime(26493): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1522)
05-14 14:51:42.620: E/AndroidRuntime(26493): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

it seems it cant find path to that files and it needs to be assets/coin... So are you telling me than you also making projects with libGDX setup tool and SpriterLoader works fine for you?

And last point Im trying this with new libGDX Gradle setup tool but I was trying this with old libGDX setup tool also but it doesnt work neither.

This stop my work for two weeks and cant get cross. Any ideas?

Thanks :roll:

Link to comment
Share on other sites

I think that only libGDX knows where assets folder is that is in Android project and is just linked to Desktop project. And because Gdx.files.internal("assets/coin/coins.scml") copy of the path of file to SpriterLoader so the path when I println to console is "assets/coin/coins.scml" so SpriterLoader trying to find that folder and file in Desktop project where is source code of SpriterLoaderTest. But this folder doesnt exist right in Desktop project because is linked from Android project.

So it seems SpriterLoader cant load those files from Desktop projects because they dont exist in that project and they are right in Android project and these are liked to Desktop project. So for that reason assets folder doesnt work and works only folder what I create in Desktop project. But android need assets folder for files and for android project doesnt work it neither.

SpriterLoader doesnt understand pathway to assets folder because it doesnt exist in Desktop project.

Maybe Im wrong but I dont know what anything else it can be :| .

Link to comment
Share on other sites

There should be no problem with linking the assets folder.

When setting the assets folder as source folder, eclipse will put it into the bin folder during build time, so the assets should be present.

Can you send me your projects (Android and Desktop)? I will test it on my machine.

- Trixt0r

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.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...