p2.js icon indicating copy to clipboard operation
p2.js copied to clipboard

Add image to p2.js

Open ghost opened this issue 6 years ago • 1 comments

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.

ghost avatar Nov 14 '18 05:11 ghost

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?

schteppe avatar Nov 18 '18 09:11 schteppe