Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by tapwater

I'm trying to get a specific entity to start at a certain rotation. I'm using the Box2D plugin. Is there a way to do this?

1 decade ago by TylerAppmobi

In Weltmeister I don't think there is a way to rotate. With Box2D I believe you can start the entity out in an angled position I though.

in the entities init function try this
this.body.SetXForm(this.body.GetPosition(), angle you want );	

1 decade ago by tapwater

Found the solution: Click the entity and add a key named angle with a numerical radian value.

The image won't rotate immediately, however. You have to refresh the page to see the rotation. Maybe we can get a fix for this, dominic? :)

1 decade ago by Hareesun

Personally I'm not a fan of radians, so you might like to try changing line 112 (or thereabouts) in impact/animation.js to...
  ig.system.context.rotate(this.angle * Math.PI / 180);

That'll allow degrees. :)
Page 1 of 1
« first « previous next › last »