Have you ever wanted to write something on computer screen in different font size? Now with magical 1.8 features you can!
Presenting: BigFont
BigFont is simple to use API for writing text using new drawing characters. It massively simplifies writing basic words using said characters. How to use explanation below.
Download Here: http://pastebin.com/3LfWxRWh
Or ingame by using command:
pastebin get 3LfWxRWh bigfont
(requires http-api to be active)As it it api you need to os.loadAPI("bigfont") it. It contains functions explained below that allow you to do the magic!
Features List:
- 4 Fast use functions: bigWrite bigPrint hugeWrite hugePrint that simpltfy writing to the max
- 2 Moderate level function: bigBlit hugeBlit for all your blitting needs.
- 2 Advanced level function writeOn and blitOn for all your unconventional writing needs.
- 1 Extra function makeBlittleText that converts text into image formated according to Bomb Bloke Blitte API
Spoiler
All images were made on max size monitor scaled to 0.5 with writeOn function.Normal font size
Using writeOn size 1
Using writeOn size 2
Using writeOn size 3
How to use:
Spoiler
Note to this api:The "\n" character is treated like normal character and does nothing. Same as in term.write()
All function use currently selected colors for the term they are wrote on. If you want to write red text on blue background simple change the colors to match that before calling functions.
Basic Usage:
Function bigWrite(sString) bigPrint(sString) hugeWrite(sString) hugePrint(sString) let you simply write in bigger font.
Simply do:
bigfont.bigPrint("Hello World")
And the "Hello World" will be printed. Beginings big and huge define font sizes (1 or 2), while write or printe define weather to move cursor to next line or leave it there.Moderate Usage:
Functions bigBlit(sString,sFront,sBack) and hugeBlit(sString,sFront,sBack) work like the Basic ones exept they do it in blit fashion. For more details hot it works see term.blit function.
Advanced Usage:
Function writeOn(tTerminal,nSize,sString,nX,nY) allows you to write in more advanced way.
- tTerminal refers to terminal object you want to write on.
- nSize refers to size you want to write in (1-3)
- sString refers to string you want to write
- nX,nY refers to place you want to write from. If a value is skipped then writeOn generates one that centers text on screen. If you want to write from current position simply pass on tTerminal.getCursorPos() in this position.
writeOn(term,1,"Ala",2,10)
will write Word Ala in fontsize 1 starting with position 2,10Example
writeOn(peripheral.wrap("right"),2,"Ala")
will write Word Ala in fontsize 2 centered on right monitorExample
writeOn(term,3,"Ala",term.getCursorPos())
will write Word Ala in fontsize 3 from current CursorPosFunction blitOn(tTerminal,nSize,sString,sFront,sBack,nX,nY) works exactly same as writeOn exept you provide all 3 blitting strings.
Tools:
Function makeBlittleText(nSize,sString,nTextColor,nBackgroundColor) is used to make text in set size(1-3) using selcted colors. It outputs table that is formatted acording to Bomb Bloke Blitte API
Change-log:
Spoiler
v1.0 - First Relasev1.1 - Added blit based functions and bugfix
Plans For Future:
Spoiler
–bigfont.blit()–Fix any bugs if found.
–Make/Find more fonts types?
Thanks to Bomb Bloke for his BLittle API and GIF API. They allowed to to easily translate termFont.png file into this api.
Any Comment and Suggestions how to improve Code are appreciated.