0

I am using libgdx, box2d and software called Tiled.

in software called Tiled I have create 2 objects on object layer. each objects I have given different property name, and value.

my question is that how can I get the property name and value using code?

i have tried:

if (mo.getProperties().get("direction").equals("left")) {
 float speed =  mo.getProperties().get("speed", Float.class);
}

getting a error: Exception in thread "LWJGL Application" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer

Tim
  • 41,901
  • 18
  • 127
  • 145
user1924249
  • 540
  • 3
  • 13
  • 38

1 Answers1

-1

Please refresh "access" directory.

As mentioned above, if you set the "direction" of the property in tiledmap. May be the reason "access" in the project file is not synchronized updates.

James Webster
  • 31,873
  • 11
  • 70
  • 114