• Editor
  • What to do without .jar runtimes?

Now that the runtimes aren't in the updates anymore how can I use the code? I just got spine and since the runtimes aren't there I thought I would just use the code from github. So I copied the src files into my project and a bunch of errors came up (after changing the package name to the new proper package) and quite honestly I don't know what to do here...Like something like this i wouldn't think would come up as an error:

The method add(Color) in the type Color is not applicable for the arguments (float, float, float, float)

I did not edit that part of the code, any suggestions on just getting the old runtimes going?

Related Discussions
...

Same question here :/ I get errors trying to compile from source.

You guys didn't say what runtime you are trying to use.

If Java, you can import spine-libgdx into Eclipse. By default it depends on gdx-backend-lwjgl. To get this, grab libgdx from github and import into Eclipse. Otherwise you can get JARs from the latest libgdx nightly. You can lso copy spine-libgdx source into your project, but you still need the libgdx JARs.

I went for the "clone in windows" option here: https://github.com/EsotericSoftware/spi ... ine-libgdx

then imported the project into eclipse, and had to grab the gdx-backend-lwjgl project from https://github.com/libgdx/libgdx (I ended up cloning the entire libgdx source, was a bit of a wait)

then i imported the related projects into eclipse (I think it was : gdx, gdx-backend-lwgl, gdx-jnigen, gdx-openal)

Once all the errors were gone and i could run tests on the spine-libgdx project, i did file->export-> jar file

Nate escribió

You guys didn't say what runtime you are trying to use.

If Java, you can import spine-libgdx into Eclipse. By default it depends on gdx-backend-lwjgl. To get this, grab libgdx from github and import into Eclipse. Otherwise you can get JARs from the latest libgdx nightly. You can lso copy spine-libgdx source into your project, but you still need the libgdx JARs.

Nate I am trying to use the libgdx runtime. After I import the libgdx project into eclipse and copy those packages into my project, a bunch of errors come up like what I said in my first post. Any suggestions? Or am I doing something wrong?

@wreed12345 could you post the list of errors?

I did have it set up, I am currently using libgdx to make my game. After I imported that project I coppied the two packages into my project like so:
 Loading Image
There currently is an error in the animation class:

The method add(Color) in the type Color is not applicable for the arguments (float, float, float, float)

An error in the skeleton class:

renderer.begin(ShapeType.Filled);

that results in this error: Filled cannot be resolved or is not a field
and also

return bones.first();

comes up with this error: return bones.first();
Next in the skeletonBinary class
"The import com.badlogic.gdx.utils.DataInput cannot be resolved" I have libgdx working so why is this here?

DataInput input = new DataInput(file.read(512));

DataInput cannot be resolved to a type (This error comes up a couple times as a parameter of multiple methods.
And lastly in the SkeletonJson class

if (color != null) slotData.getColor().set(Color.valueOf(color));

The method valueOf(String) is undefined for the type Color

name = (String)map.get("name", name);

The method get(Object) in the type ObjectMap is not applicable for the arguments (String, String)

AttachmentType type = AttachmentType.valueOf((String)map.get("type", AttachmentType.region.name()));

The method get(Object) in the type ObjectMap is not applicable for the arguments (String, String)

Color color = Color.valueOf((String)valueMap.get("color"));

The method valueOf(String) is undefined for the type Color

Any ideas on what to do? I tried updating my libgdx jar but that didn't do anything...Any ideas?

@wreed12345 hmm, i've not tried copying over the packages as you did, mainly because I haven't been able to sort out the java build paths afterwards(which is what looks to be the cause of the errors in your case, though i may be wrong). Maybe someone who's better versed in how java works could help you with this method?

Like I mentioned in my earlier reply, i've imported spine-libgdx into it's own project, and basically dealt with the build path errors (which were mainly with it requiring libgdx lwgl backend) by syncing down libgdx's source and importing those projects as well, then exporting a jar.

I have it imported as its own project, but how then do I use the code in one project in another project?

Also, with the spine-libgdx project i synced down from git, the tests in the project worked (after changing the string names of the files it was trying to read, as they were still in the old format when i had synced it down)

So I'm thinking that this is not an error with spine-libgdx.

@[borrado]

If there are no errors with the project, export it as a jar
File -> Export , under Java you should see the jar option.

Edit: choose JAR file. Also add it to your build path. I have a libs folder in my personal project where i put jars, and then I add them by going into my project properties.

After importing the project there is an exclamation point on the project folder, does that mean an error?

also why is it that the jar runtimes are no longer in that runtime folder

Yes, if you check out the errors pane, I'm guessing it will be requiring a certain project along the lines of gdx-backend-lwgl or something like that.

I was in a bit of a hurry when i did this, and I may have messed it up, but when i tried just putting the jars in a folder and adding them to the build path of spine-libgdx i couldn't get it to work, so i ended up syncing the libgdx source off here: https://github.com/libgdx/libgdx

which i then imported all the required projects as stated in my earlier reply. That fixed it.

wreed12345 escribió

also why is it that the jar runtimes are no longer in that runtime folder

The answer's here:
viewtopic.php?f=3&t=330

If there's an exclamation point, check the build path of the project. You can find some problems there (maybe a lib that is missing, like gdx-natives.jar in gdx project).

Well I have eliminated that exclamation point by importing the libgdx master and all that fun stuff - but now there are only two errors:
Animation.java

color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);

The method add(Color) in the type Color is not applicable for the arguments (float, float, float, float)
and also skeleton.java

renderer.begin(ShapeType.Filled);

Filled cannot be resolved or is not a field

I was using the latest stable build so thats probably why

I think my head is starting to hurt...can someone maybe send me the jar? my attempts aren't working too well...

Here's the jar i'm using, hope it works for you!

Well thanky ou for that although I am getting an error when writing:

		SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("skeleton.json"));

Exception in thread "LWJGL Application" java.lang.NoSuchMethodError: com.badlogic.gdx.utils.OrderedMap.get(Ljava/lang/Object;Ljava/lang/Object😉Ljava/lang/Object;
at com.esotericsoftware.spine.SkeletonJson.readAttachment(SkeletonJson.java:156)
at com.esotericsoftware.spine.SkeletonJson.readSkeletonData(SkeletonJson.java:132)
at com.reed.birdseye.GameScreen.<init>(GameScreen.java:61)
at com.reed.birdseye.BirdsEye.create(BirdsEye.java:11)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:144)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:131)
AL lib: ReleaseALC: 1 device not closed

This seems like libgdx but what in it...?

Sorry you are having trouble, but it looks like an outdated libgdx still.

wow, I thought I did that already...But anyhow it works now. Thank you very much for the help Nate! Do you have any idea if this nightly build got rid of the old fps cap? things seem to be going much faster now....

I see that they removed the cpuSync setting, so I think they set it to false, that's why you are seeing everything faster (or smoother).

Yeah, vsync on and cpu sleep off is the default.

erm sorry if this sounds noobish but how do I set it back on?

When you create LwjglApplication pass it an LwjglApplicationConfiguration with foregroundFPS=60. I just made this the default though, so you can get the nightlies again tomorrow and it'll use 61 as the default.

ok awesome, any ideas why this works great when the game window is selected but if i click on another window the fps gets bumped up to the max ammount (aournd 1,000fps)

ohhh wait just took a look at the source code and saw I had to edit background fps too.

Nate escribió

If Java, you can import spine-libgdx into Eclipse. By default it depends on gdx-backend-lwjgl. To get this, grab libgdx from github and import into Eclipse. Otherwise you can get JARs from the latest libgdx nightly. You can lso copy spine-libgdx source into your project, but you still need the libgdx JARs.

I have Spine runtimes cloned and libgdx one added to eclipse and to main project as dependency. Desktop starter works fine, but android version crashed with following error:

[2013-04-08 16:44:59 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/badlogic/gdx/Application$ApplicationType;
[2013-04-08 16:44:59 - ProjectRogue-android] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/badlogic/gdx/Application$ApplicationType;

My suspicion is that lwjgl is exported as well as android backend and it makes it break. Its unchecked in spine project export preferences. Any ideas?

Android projects only export what they have checked. They don't use transitive dependencies. Not sure why your project is broken. 🙁

Eh ive fixed it somehow. Checked out older version of android project, played with export checkboxes and it works now.