Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

TIC-80

Fantasy computer for making, playing and sharing tiny games. · By Nesbox

UI library TICuare and request for trim() function

A topic by Crutiatix created Apr 05, 2017 Views: 518 Replies: 5
Viewing posts 1 to 5
(+1)

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.

Developer

Hi,

Of course, I created 'trim' issue on the Github https://github.com/nesbox/tic.computer/issues/81

People will be able create business apps with TIC If this goes on, joking :)

great job btw, thanks

Kaboom!! Now I'm expecting TicOs in a feew months :)

(+1)

@Nesbox Thanks for answer on my request! :)

@HomineLudens Good idea! It's maybe better than make TIC in TIC. Its name would be TIC-TAC :D

@Crutiatix do you plan to work on Ticuare more? It would really benefit from getting more documentation/tutorials and getting on par with newest version of TIC. While example code is good if I remember correctly example is different version than last and one just doesn't work with TIC without some fixing. I am using this in prototyping, but little scared of taking it to next level and make it core of my game if it's abandoned already.

(1 edit)

@DagonDev Hey. I am not actively developing TICuare for now, but it is not abandoned. If there will be reported any bug at its github then I will fix it. If you find any bug, or you are missing a feature then report it at TICuare's github and I will look at it. :)