» Edit Game Info

2 months ago by stcredzero

I've been getting some transform creep in my game, which uses some Javascript canvas commands to draw "vector" graphics. However, I am slowly getting some transform creep, despite going on a mission to apply and context.restore() in my code. Is there a good place in ImpactJS in which to add a context.resetTransform() statement? Is there a spot in the ImpactJS loop where the system expects the transform to be the identity matrix, or at which the current transform can be easily restored from side data, like the camera position?

2 months ago by Joncom

I think you have the correct idea. Just make sure you save() before performing a transform, and then restore() after drawing the transformed graphic(s).

2 months ago by stcredzero

Thanks. My latest test shows no creep.
Page 1 of 1
« first « previous next › last »

Post Reply

Please login or register to reply.