Jump to content




Stitch - Massive Monitors!


  • You cannot reply to this topic
5 replies to this topic

#1 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 26 March 2016 - 02:14 AM

Stitch isn't a new idea, but it's certainly a useful one.
The basic idea is to create a larger monitor out of multiple smaller ones. The implementation is anything but basic.
Installation and Setup
For the lengthy, human-readable API, download from rKU6E2K4 (~9,774 bytes)
Since I was overly-verbose in variable naming, a minified version is available from CTrVdFK9 (~3,812 bytes)
You can load the API through either os.loadAPI or dofile; it will detect which one automatically. If you are in need of multiple instances, you will want to use dofile
Examples
There is one very important function that seperates this from a normal terminal object.
stitch.setMonitors( table t )
The table provided is to be a table of strings, which refer to monitors (eg "monitor_0"). It is a two-dimensional table, in the order t[ y ][ x ]. This means the table is visually similar to the layout of the monitors when viewed from the front.
Example Table
Before you do ANYTHING with the virtual monitor object, be sure to set the monitors. It sets up several internal variables, meaning the results of calling functions before it range from overwriting those changes to outright errors.
After the monitors have been set, you may easily use term.redirect to run practically anything on this giant monitor.
term.redirect( stitch )
stitch.setTextScale( 5 )
print( "Hello, world!" )
A rather useful feature of my API is the overriding I do on the peripheral API functions and event system. "stitch" is a valid monitor for all intents and purposes. Please note that having multiple instances will not be individualized, and may have unintended consequences when used this way.
For testing, I used this clever program to run any program on the monitor:
Spoiler
Finally, we have the two functions which, if misused, will screw things up. For efficiency purposes, the monitor object acts as a buffer, and is updated every 0.05 seconds (20 times per second). I have included the ability to disable this functionality and manually control the buffer updates.
WARNING: Do you really need to do this?
Known Bugs:
Any text drawn at an x value of 0 or less will not show up. Fixed!
term.scroll incorrectly determines length of background colors string Fixed!
Screenshots
Credits
Update!
+Fixed known bugs
+Added redraw() and setVisible( boolean visible )
Update!
+Changed behavior of redraw and setVisible
+Fixed a crash bug

Edited by KingofGamesYami, 06 November 2016 - 09:49 PM.


#2 Creeper9207

  • Members
  • 211 posts

Posted 26 March 2016 - 03:20 AM

no screenies? :(

#3 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 26 March 2016 - 04:45 AM

View PostCreeper9207, on 26 March 2016 - 03:20 AM, said:

no screenies? :(

Here's one he posted elsewhere:

Posted Image

#4 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 26 March 2016 - 12:56 PM

View PostCreeper9207, on 26 March 2016 - 03:20 AM, said:

no screenies? :(/>

Added a couple screenshots of paint running.

View PostBomb Bloke, on 26 March 2016 - 04:45 AM, said:

-snip-
Here's one he posted elsewhere:
-snip-

It's a little bugged in that screenshot (notice the menu)

Update!

+Fixed known bugs
+Added redraw() and setVisible( boolean visible )

Edited by KingofGamesYami, 26 March 2016 - 01:34 PM.


#5 wilcomega

  • Members
  • 466 posts
  • LocationHolland

Posted 02 April 2016 - 11:57 PM

Thats really really cool!

#6 Luca_S

  • Members
  • 407 posts
  • LocationGermany

Posted 05 July 2016 - 12:34 PM

WOW

This is a really cool program. And it is really useful too. I'm definitely gonna test this ASAP!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users