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

9 years ago by tyler

I wanted a entity to match its position to background layer that had a distance of 1.16. It looks like theres no official way to do this so I hacked this quickly. I just override the draw method with this:

	draw: function() {
		if( this.currentAnim ) {
				(Math.round(this.pos.x) - this.offset.x -,
				(Math.round(this.pos.y) - this.offset.y -

Its not perfect, but its as close as I can get. Im sure there is a better way, I just dont know what it is.

9 years ago by tyler

Btw, this.distance is a prop you give your entity. In my case its set to 1.16

9 years ago by stahlmanDesign

Seems like an elegant solution to me. You're saying it's not precise?

9 years ago by tyler

It seem to screw with the animation a bit. It looks like is jumps though some frames too quickly.
Page 1 of 1
« first « previous next › last »