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 playman

Hi guys I just recently purchased ImpactJS and here is my first question:

Seeing this:

http://playman.nixiweb.com/imgs/offset1.png
http://playman.nixiweb.com/imgs/offset2.png

How can i do this?

http://playman.nixiweb.com/imgs/offset3.png (Numbers is just an example, not real pixels).

Thanks!

1 decade ago by StuartTresadern

I assume that you want to create a smaller collision area ? if so change this.size.x and this.size.y to your required size and then use the offset to align the sprite image.

1 decade ago by StuartTresadern

Should have also said if its based on one of the sample player entities its set like this size:{x:16, y:32}.

1 decade ago by playman

Ok done! So the size property is for collision area, not for sprite area :P

Many thanks!

1 decade ago by StuartTresadern

Correct, you define the sprite size when setting up the animation sheets:
new ig.AnimationSheet('playerwalk.png', 64, 96),
Page 1 of 1
« first « previous next › last »