Difference between revisions of "Term.blit"

From ComputerCraft
Jump to navigation Jump to search
m (colored output text)
m (I'd say this page is pretty damn complete.)
 
Line 1: Line 1:
{{Incomplete|reason=this page is being written by [[User:Khuxkm|Khuxkm]]}}
 
 
{{API doc function
 
{{API doc function
 
| name = term.blit
 
| name = term.blit

Latest revision as of 01:38, 27 March 2020

term.blit
Function
Syntax
term.blit()
Returns nil
API term
Source CC:Tweaked (source)

Writes text at the current cursor position in the current term, using foreground colors from textColour (a string containing colors as used in images loadable by paintutils functions) and background colors from backgroundColour (same as textColour). All characters represent a single hexadecimal digit which is then plugged into the equation c=2^(h-1) where h is the hexadecimal plugged in and c is a the equivalent color that would be plugged into term.setTextColor.

ExampleExamplePrint rainbow text
Prints "Hello world!" in 11-color text.
Code
term.blit("Hello world!","01234456789a","f00000000000")
Output Hello world!