Characters and State

One of the good points of my previous React version of SGEdit was the Character Set. Instead of having 200+ image files to load, I encoded them into base64 and they are just a Javascript array now. This meant it was fairly easy to get the characters on screen in a palette of blocky goodness.


Once that was done, I wanted to add a primary and secondary character (left and right mouse buttons) which required me to store the state for the app. Previously I used Redux which is fine but rather clunky so I searched around for something new and found HookState which requires much less boilerplate code. Yay!

The code is on GitHub if you want to follow along with the code. The WIP output will appear here. Thanks for reading.


No comments:

Post a Comment

Magic Mirror On The Screen

Well this doesn't need much explanation either... mirroring. Again the buttons aren't amazing but are functional.  The code is on  G...