I wanted to be able to roll a ball around a mobile screen as you rotate the device through a 360 degree rotation. Even though the Physics engine supports gravity as a vector, C2 only supports changing gravity in Y.
Acts.prototype.SetWorldGravityVector = function (gx,gy)
{
//if (g === this.behavior.worldG)
// return;
this.world.SetGravity(b2Vec2.Get(gx, gy));
//this.behavior.worldG = g;
// Wake up every physics instance
var i, len, arr = this.behavior.my_instances.valuesRef();
for (i = 0, len = arr.length; i < len; i++)
{
if (arr.extra.box2dbody)
arr.extra.box2dbody.SetAwake(true);
}
};