I just remade my p5js button system and it is so much better than the old one, I can do way more cool stuff with it now

old one:
- runs off of 100% array jank
- many janky parts required, not well contained
- making a button involves writing one big and janky function
- buttons must be manually refreshed
- can only be colored rectangles
- rigid and slow to use

new one:
- its a javascript class
- 90% of the important parts are in the class
- highly modular due to using objects
- includes functions that are run when hover began/ended and input began/ended
- includes timers based on interactions that allow for better effects
- all functions can be easily overridden for custom visuals and behavior
- way faster to edit and easier to read

and to test it I made a very cool button and I can confirm it is like 100x better than the old system

want to see it in action or steal it? (I don’t mind) https://editor.p5js.org/7vector/sketches/7DXk4U_iW

2 days ago
4 0 0

comments