Closed karlcleveland closed 3 years ago
I posted the solution to this on Oct 30, 2018 look for issues "Sprite sheets not working correctly with p5.js >= v0.5.5"
did you try it ?
Thank you! That worked for the animated sprites. But, as referenced in #136, the tile_sprite_sheet did not work because it is not animated and uses a different function (drawFrame). So, it appears that in addition to line 3571, line 3926 also needs to be updated from:
pInst.image(this.image, frameToDraw.x, frameToDraw.y, frameToDraw.width, frameToDraw.height, x, y, dWidth, dHeight);
to:
pInst.image(this.image, x, y, dWidth, dHeight, frameToDraw.x, frameToDraw.y, frameToDraw.width, frameToDraw.height);
With these two changes, everything works.
just adding a +1 to this! drawFrame() is at line 3954 for me, in the currently available download from the p5.play site, and this fix fixes it. Did you submit a PR karl?
Does a PR fix this ?
Perhaps @islemaster will know the answer. This has been a recurring issue that seems easy to address. Is there a reason the proposed fix wasn't merged?
Alright, I figured out how to github and the fix has been implemented, hopefully it doesn't break other things...
While experimenting with p5.play, I keep running into issues with sprite sheets not functioning correctly. If I role back the version of p5.js to the 2016 version used in the online examples, it works fine. But, sprites sheets don't work correctly in the current version of p5.js (v1.1.9). For example, the exact code/files used in the online example for sprite sheets (http://molleindustria.github.io/p5.play/examples/index.html?fileName=sprites_with_sheet.js) will not function with the current build of p5.js.