Jump to content

jaunusa

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by jaunusa

  1. Would be nice to be able to swap with images from a atlas/spritesheet. Right click "replace selected sprite image" only works on images, not on images within an atlas.
  2. Thank you for your answer, haven't realized that GWT doesn't support reflection. I'm relatively new to Java/LibGDX, so I have no concrete idea how to substitute the getDeclaredConstructor implementation with the one from LibGDX. LibGDX has some Reflection system that supports GWT, but it works only with constructors without parameters. Maybe that is what you mentioned, hopefully that functionality is integrated in future releases. At the moment I don't need the static Spriter managment, so I just deleted all static methods containing getDeclaredConstructor and InputStream in the Spriter class. That works fine for me for now.
  3. You wrote a few posts ago that the library now works also with GWT. I tested that and it works when compiling for dev: >gradlew html:superDev But when I compile for distribution, I get these error: >gradlew html:dist Compiling module com.mygdx.game.GdxDefinition Validating units: [ERROR] Errors in 'file:/C:/workspace/CharacterAnimation/core/libsrc/com/brashmonkey/spriter/Spriter.java' [ERROR] Line 75: The method getDeclaredConstructor(Class<?>[]) is undefined for the type Class [ERROR] Line 96: No source code is available for type java.io.FileInputStream; did you forget to inherit a required module? [ERROR] Line 113: The method getDeclaredConstructor(Class<?>[]) is undefined for the type Class [ERROR] Line 145: The method getDeclaredConstructor(Class) is undefined for the type Class [ERROR] Aborting compile due to errors in some input files :html:compileGwt FAILED Any ideas what is wrong?
  4. I extended the PlayerTweener and did some implementations that cover my needs. I added the speed calculation in a custom update(float delta) method that sets the speed depending on delta time. I hope that is the correct approach to have the same animation speed with a dynamic frame rate. public void update(float delta){ player.speed = Math.round(900 * delta); ... } I still have some problems handling multiple animation tweens. It works fine when you simply tween from "anim1" to "anim2" and when it's completed to "anim3". But when you are at a weight of 0.5f in between "anim1" and "anim2" and you want to interpolate from that current state to "anim3", it don't work properly. I don't think is possible to get such a interpolation properly with a system managing two players and setting the weight in between. Or am I wrong? I know, normally in a game a transition takes about 20ms, then it doesn't matter. But in my game the transitions are a little bit slower, so there will be some problems if I have to wait the animations to be completed to switch animation. Thanks again for your help and the great inputs.
  5. Thanks a lot Trixt0r, that is a great advice. I think that solves also my problem of removing a listener from a Player right at the moment when the method animationFinished() of the listener is called. I always got an error when update() is called right after I removed the listener. Is that because of the Player still iterating through the Array while I remove the listener from it? But when I handle the events from the listener inside the extended PlayerTweener, I probably won't have that problem. A little bit more examples or more explanations in the wiki would be good. Maybe also regarding the following questions: Animation speed/time step Am I supposed to control the speed of the Player by myself to achieve a constant speed on all devices? I haven't found something related to that in your code, only the dependence of the speed value. When I understand it correctly, on every update you proceed 15 ms in time. Why 15 ms? Wouldn't it be easier to control it by a float from 0 to 1? Looping animations I don't really understand from where the looping value in the Animation class comes from. I thought when I disable the "Repeat Playback" button on top of the timeline in Spriter, the animation is played only once, but it is still looping. Do I have to handle that with the animationFinished() method from the listener? Changing bone parent I'm not sure if it is a bug, but there is a strange positioning problem on bones that change parent. It's more or less like the situation in this Spriter video .When a bone changes the parent bone (or is created) somewhere in the middle of the timeline, the attached image is positioned at (0, 0) and is not moving/rotating. Strange is that it works when you play it directly in player1 or when you set the animation on the same player. But when you play the animation in a second player and set the weight immediately to that player, it doesn't work correctly. EDIT: I tested it again in a different setup. It happens always when the bone count isn't the same in different animations. You already wrote that in the wiki on git. //create() player = new PlayerTweener(reader.getData().getEntity("boy")); player.getFirstPlayer().setAnimation("walk"); player.setWeight(0); //touchUp() //works player.getFirstPlayer().setAnimation("animationChangingBone"); //doesn't work player.getSecondPlayer().setAnimation("animationChangingBone"); player.setWeight(1);
  6. Hey I started using Trixt0rs Java Library to control my Spriter animations. I'm trying to control the animation speed by myself. For that I call the Players setTime(myDelta) method with my custom elapsed time. I do that because the animation has to be perfectly in sync with another part of my game. Calling setTime(myDelta) and then update() works fine when I use Player, but when I switch to PlayerTweener it is no more possible to control time manually. Do you have an advice for handling that? At the moment I set the weight for the interpolation/transition from one animation to the other with the Java Universal Tweening Engine. Is it possible to do that automatically with Trixt0rs Library? Would be nice to get some help here. EDIT: Sorry for bothering you about the setTime() problem I had with the PlayerTweener. I made a mistake by using a wrong value for setTime(). It works perfectly when you set the correct time values to both players in PlayerTweener.
×
×
  • Create New...