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

Interface utilities - Handy for multiple screens!

Started by Engineer, 18 April 2013 - 01:43 AM
Engineer #1
Posted 18 April 2013 - 03:43 AM
Hello everyone,

I present to you:

Interface Utilities!

It stores your commands ( look below! ) in a buffer. When you think you have completed your buffer, you make from that a page. You can call that page whenever you want, and it supports multiple pages. So you can call page 1, then page 2, and then page 1 again!

These pages are not pages printed by the printer. It it is the display on your screen.

Here is the documentation, if something is not clear, please post it below.

		.bufferWrite( yourText [, textColor [, backgroundColor ].] )
		It is added to the buffer, and ofcourse it just writes as normal.
		Optional text and background color.
		Everything is added to the buffer.
		It will overwrite if the starting point has the same coords.

	.bufferPrint( yourText [, textColor [, backgroundColor ].] )
		The same as write, but use print instead of write :P/>/>
	
	.bufferLine( xMin, yMin, xMax, yMax, lineColor)
		Using the paintutils API, add the line to your buffer

	.bufferSetColor( textColor, backgroundColor )
		Set the main colors of your page
	
	.returnBuffer()
		Returns the current buffer.
		The buffer is one table with subtables in it, you most-likely dont need this, but it is added in

	.bufferClear()
		Delete all the contents of the buffer

	.bufferButton( xMin, yMin, xMax, yMax [, backgroundColor [, yourText [, textColor].])
		Add a graphicall button to the screen and buffer
	
	.createPage()
		This will create the page from the current buffer. IT WILL NOT CLEAR THE BUFFER, and thats intentional. If you want to make
		two pages wich are similair, with only a slight change you can add this to a new page.

	.loadPage( pageNumber )
		Load all the contents of the created page

As far as updating goes, my github is the most updated version. I will release 'finished' versions on pastebin as well.
The pastebin version: http://pastebin.com/HM01pq5Q

So if you find a bug, please report it here with the version number.
Or report it on the gitHub

Changelog
Spoiler[17/4/2013] - Initial Release

Also, feedback is appreciated :)/>
And please, leave credit if you use this in published work.

-Engineer
theoriginalbit #2
Posted 18 April 2013 - 03:53 AM
So when you say 'page' do you mean printed page, using the printer peripheral, or just displayable screens on the terminal?
Engineer #3
Posted 18 April 2013 - 04:01 AM
The displayable terminal screen :P/>

Also edited in OP, thanks :)/>
Engineer #4
Posted 21 April 2013 - 05:22 AM
Bump.

Also using gitHub now instead of my own site. I cant use HTML and CSS properly, or at least not to my ideas.