This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Sewbacca's profile picture

Term.blit extension

Started by Sewbacca, 10 October 2016 - 03:43 PM
Sewbacca #1
Posted 10 October 2016 - 05:43 PM
Hey guys,
How could i implement a mask or an char for term.blit, to let him skip writing chars (that it doesn't edits the screen)?
Two examples:

term.blit(''Hello world!', 'ffffffffffff', '000000000000', '##	   #  ')
-- or
term.blit(''Hello world!', 'ffffffffffff', '##0000000#00')
--[[ Output:
  llo wo ld
--]]
I want to have the best performance.
Edited on 10 October 2016 - 05:06 PM
Lyqyd #2
Posted 10 October 2016 - 05:45 PM
Simply use a buffer to keep track of the current screen contents. Overwrite the sections of the buffer that need to change, then blit the entire line from the buffer for any lines that have changed.