Jump to content

kabb

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by kabb

  1. Sorry guys, for not responding to your questions. I am quite busy now.

    @Aniketos: The ref is null in the first place, because the loader is putting a null reference into the texture map and in a next step the actual loaded file reference will replace the the null reference. Are you loading will multiple threads?

    @kabb: This is really weird. It should work. Could you send me your whole code?

    - Trixt0r

    I ended up figuring out the problem was that I needed to get and use the SpriterModObject for the torso, not the SpriterObject.

  2. I've been having a bit of trouble manipulating bones at runtime. Currently, I'm using this code in my render loop:

    //Update position
    player.update(x, y);

    //Get torso bone and set angle
    SpriterBone torso = player.getBoneByName("Torso");
    Vector2 mouseLoc = new Vector2(Gdx.input.getX(), Gdx.input.getY());
    Vector2 playerLoc = entity.getComponent(Physics.class).getLocation().toCameraCoords();
    float angle = MathUtils.atan2(mouseLoc.y - playerLoc.y, mouseLoc.x - playerLoc.x) * MathUtils.radDeg;
    torso.setAngle(angle);

    //Render player
    spriteBatch.begin();
    spriterDrawer.draw(player);
    spriteBatch.end();

    However, the torso's angle never updates from it's original angle (which is 90 degrees). The player is running an idle animation while I try to do this, but that animation never actually changes the torso in any way, so I'm not sure why the angle won't update. Anyone know what I'm doing wrong?

×
×
  • Create New...