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

Stitchet Type-In From Dragon User January 1985

This is an interesting yet short type-in from Dragon User January 1985 . The final REM lines include details for running in PMODE3 so I have...