Skip to content

RandomGamingDev/Pixyp5js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixyp5js

Pixy (Credit to Nyaaborn for the name, you can find his github here: https://github.com/Nyaaboron) from Wireframe, but for p5js

Pixyp5js is a version of Pixy (which is for the Wireframe), but for p5js!

A library for easily more easily dealing with pixels in images during runtime

There's an example for how to use the library in https://github.com/RandomGamingDev/Pixyp5js/tree/main/example with its result visible here

To use the library simply create a new instance of the pixy class with the offset, size and resolution (they're all arrays with 2 elements) and then just change the Pixy.pixels array via Pixy.setPixel(), update the pixel buffer via Pixy.updatePixels() and execute Pixy.display() in order to display (if you need to do something that involves shader simply activate the shader before calling Pixy.shaderDisp() with the shader as the first parameter (this is since p5.js doesn't currently support shader overloading for the image function))!

To use it you can simply include https://cdn.jsdelivr.net/gh/RandomGamingDev/Pixyp5js/pixy.js in your HTML file! If you want to you can also just download the file and include it in your HTML file that way.

btw stuff updates so remember to specify a version/commit for your library if you want to use a link and don't want your code to automatically update to the newest version of the library