schteppe / p2.js

JavaScript 2D physics library
Other
2.63k stars 330 forks source link

Add image to p2.js #338

Open ghost opened 5 years ago

ghost commented 5 years ago

Hello, How can we add image into p2.js and do physics stuff (you know, drag an image, drop there, etc). There is option to use p2 with phaser but my client want smallest size of project. Any recommendation or pointers.. Cheers.

schteppe commented 5 years ago

Hi, p2.js is only a physics library. You can use its output to render in whatever way you want. HTML5 canvas can be used if you want to render an image at a position in a canvas element, and it doesn’t require any library for rendering. See the examples list here: https://github.com/schteppe/p2.js/blob/master/README.md#examples

What kind of drag and drop effect do you have in mind?