Greetings.
I decided to port for TIC-80 the simple UI library originally named Uare developed for LÖVE by Ulydev. I renamed it to TICuare. They are not compatible between each other. It neither wasn't my intention, but nevertheless it's handy library.
A basic functionality is done. Check out TICuare's github. I hope you'll like it :)
But, it's not fully functional as the original library Uare. I had a problem to implement trim function (or scissor as it's named in LÖVE API). It's quite important function because without it, it's not possible to wrap bigger content to smaller box, so it could work as window with posibility to scroll content.
I tried to implement it by two functions: one for save a screen called every time before drawing content of window and other one for draw back the saved screen data except a defined area in which lay desired content of the window.
Functionality was not problem. Problem was performance. These functions had to be called for every element with content, 60 times per second. It dramatically reduced performance.
I'm not very experienced programmer but I think that a better solution would be implement function which restrict drawing on screen directly in a individual drawing functions. So, a solution would by to write my own drawing functions, but it would take a lot of bytes in code. Now the minified version of TICuare has cca 10KB so I have not much more space if it should stay usable.
Would it be possible to implement trim function directly into the TIC API?
My vision is trim(x,y,with,height) - limits drawing area to x,y,width,height. Called with no arguments trim() - allow drawing everywhere on screen.
Thanks for any reply.
Best regards.