Jump to content

arnelpogs

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by arnelpogs

  1. hello trixtor, just having some experiment and i already know the problem regarding on loading spriter on iOS. and i finally make it work now. in your SpriterLoader.java the abstract 'load' method parameter 'path' seems having a value different in android and desktop. when running in desktop and android the value of the 'path' is the image internal path (e.g. dir/head.png dir/body.png ... ... etc) while when running into iOS the value of the 'path' became the image absolute path. (e.g. /Users/arnelespiritu/Library/Application Support/iPhone Simulator/7.0/Applications/77C753E6-2712-4650-94D3-6BB805364B12/RunPogsRunGame.app/scml//head.png /Users/arnelespiritu/Library/Application Support/iPhone Simulator/7.0/Applications/77C753E6-2712-4650-94D3-6BB805364B12/RunPogsRunGame.app/scml//face.png so i modify your SpriterLoader.java load method a bit. @Override public void load(final Reference ref, String path) { //System.out.println(path); FileHandle f = null; switch(Gdx.app.getType()) { case Android: case Desktop: f = Gdx.files.internal(path); break; case iOS: f = Gdx.files.absolute(path); break; default: break; } if(f==null) return;//other platform. yet not tested if(!f.exists()) { System.out.println(path); System.out.println("image not exist"); return; } if(packer == null && this.pack) packer = new PixmapPacker(2048, 2048, Pixmap.Format.RGBA8888, 2, true); final Pixmap pix = new Pixmap(f); if(packer != null) packer.pack(ref.fileName, pix); //files.put(ref,null);//Put first the reference into the map, in the next frame, the null value will be replaced with the actual texture. //Gdx.app.postRunnable(new Runnable(){ //Post the creation of a OpenGL Texture to the LibGDX rendering thread. //This is necessary if you are loading the scml file asynchrouously with more than one thread. // @Override // public void run() { files.put(ref, createSprite(new Texture(pix))); pix.dispose(); // } //}); } i hav'nt test on webGL yet also on applet. anyway thanks trixtor this api is so cool.keep it up, im looking forward on your work thanks.
  2. hello trixtor, thanks for the early response. you can see my code here https://github.com/pogsdbest/runpogsrun i implement the test in my main class RunPogsRunGame.java.
  3. hello trixtor, i finish my test sample using your awesome Library for Spriter/java , it works well on my android device and Desktop as well. and now i've tried it on iOS using RoboVM for libGDX which gives me some null pointer exception error. here's the stackTrace. Exception in thread "main" java.lang.NullPointerException at com.brashmonkey.spriter.objects.SpriterObject.setRef(SpriterObject.java) at com.brashmonkey.spriter.player.SpriterAbstractPlayer.generateData(SpriterAbstractPlayer.java) at com.brashmonkey.spriter.player.SpriterPlayer.(SpriterPlayer.java) at com.brashmonkey.spriter.player.SpriterPlayer.(SpriterPlayer.java) at com.pogs.runpogsrun.RunPogsRunGame.create(RunPogsRunGame.java) at com.badlogic.gdx.backends.iosrobovm.IOSGraphics.draw(IOSGraphics.java) at com.badlogic.gdx.backends.iosrobovm.IOSGraphics$1.draw(IOSGraphics.java) at org.robovm.cocoatouch.uikit.UIView$Callbacks.draw(UIView.java) at org.robovm.cocoatouch.uikit.UIApplication.UIApplicationMain(Native Method) at org.robovm.cocoatouch.uikit.UIApplication.main(UIApplication.java) at com.pogs.runpogsrun.RobovmLauncher.main(RobovmLauncher.java)
  4. sorry for the next post. i found out the source of the error. i must set the LwjglApplicationConfiguration.useGL20 when using trixtors SpriterLoader.java, the 'useGL20' is set to false in default when creating a project on Aurelien Ribon 's GDX-SETUP-UI. LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); cfg.title = "run-pogs-run"; cfg.useGL20 = true; // enable 'useGL20' to make textures that not a power of 2 cfg.width = 480; cfg.height = 320; new LwjglApplication(new RunPogsRunGame(), cfg);
  5. hi trixtor im having a problem with this line in SpriterLoader.java with the current libgdx nightlies, it seems can't create a texture that is not a power of 2 . . files.put(ref, createSprite(new Texture(pix))); . . here's the stack trace, Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Texture width and height must be powers of two: 137x152 at com.badlogic.gdx.graphics.GLTexture.uploadImageData(GLTexture.java:241) at com.badlogic.gdx.graphics.Texture.load(Texture.java:145) at com.badlogic.gdx.graphics.Texture.(Texture.java:133) at com.badlogic.gdx.graphics.Texture.(Texture.java:116) at com.pogs.runpogsrun.util.SpriterLoader$1.run(SpriterLoader.java:70) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.executeRunnables(LwjglApplication.java:238) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:193) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
  6. thanks trixtor. the spriter is now refactored and working well. awesome stuff. i will used this for my next work with libgdx and spriter cool.
  7. hello trixtor, awesome work. is there a stable build of this project so that i can try it with mine. i cloned your repo on github(https://github.com/Trixt0r/spriter) but it seems there are some compilation errors. thanks looking forward for your work.
×
×
  • Create New...