171 posts
Location
Study: United Kingdom Native: Latvia
Posted 20 September 2013 - 06:04 PM
sAPIHello everyone. I present to you
sAPI. It is used to connect multiple screens in a single one and use it as a whole. It has all the same commands that a monitor peripheral does, and it uses full x, y coordinate system, which means that you have to write your code as if the screen was one huge.
Planned Features:- Event handler, which would return the screens coordinates.
- Drawing of different shapes.
- Different monitor size support.
API:Spoiler
http://pastebin.com/BctNZuKM
pastebin get BctNZuKM sAPI
- sAPI.setMonitors(monitortable)
Takes a monitor table as an argument. In the table you have to have a table for each row, even if you have only one. Inside the rows you only have to list the monitor ID's not the full names. Example table: {{"25", "19"}, {"18", "24"}}
- sAPI.printNames()
Finds all connected monitors and prints their network names on the screens.
- sAPI.getSize()
Returns the size of the whole screen (All monitors summed up together).
- sAPI.setCursorPos(x, y)
Sets the cursor position to the x and y coordinates.
- sAPI.getCursorPos()
Returns the current cursor position.
- sAPI.writeText(text)
Writes text starting from the current cursor position.
- sAPI.printText(text)
Writes text starting from the current cursor position but also wraps the text if it is longer than the screen width (divided by spaces if possible).
- sAPI.slowPrintText(text, delay)
Same as sAPI.printText, but you can set the delay between each character.
- sAPI.clear()
Clears the entire screen.
- sAPI.clearLine(y)
Clears the specified line.
- sAPI.setBackgroundColor(color)
Sets the screens background color.
- sAPI.setTextColor(color)
Sets the screens text color.
- sAPI.fillBox(x, y, width, height, character)
Draws a box at the specified coordinates with the specified width, height and character.
- sAPI.setTextScale(scale)
Sets the scale on the entire screen.
Example Program:Spoiler
http://pastebin.com/uUn88TrP
pastebin get uUn88TrP example
Example output:
28 posts
Location
pcapi.location
Posted 21 September 2013 - 04:12 AM
Three words:
This. Is. Amazing.
62 posts
Location
In my computer house located in a random village, programming.
Posted 21 September 2013 - 05:44 AM
I haven't tried this, but sapi means cow in my country's language.
171 posts
Location
Study: United Kingdom Native: Latvia
Posted 21 September 2013 - 10:25 AM
I haven't tried this, but sapi means cow in my country's language.
I don't know why but I can't change it to sAPI it changes back to Sapi.
7508 posts
Location
Australia
Posted 21 September 2013 - 10:44 AM
I don't know why but I can't change it to sAPI it changes back to Sapi.
Your answer
171 posts
Location
Study: United Kingdom Native: Latvia
Posted 21 September 2013 - 10:46 AM
I don't know why but I can't change it to sAPI it changes back to Sapi.
Your answer
I've had an IP board before and I had this problem as well. It was in setting something like force lowercase or something.
1 posts
Posted 22 September 2013 - 05:13 AM
Very nice if you yould need a HUGE monitor for your program.
128 posts
Location
South Africa
Posted 24 September 2013 - 12:43 PM
This is good, I like it. I would use it in multiple worlds or on a server.
171 posts
Location
Study: United Kingdom Native: Latvia
Posted 24 September 2013 - 12:50 PM
Updates!
Added:
- sAPI.slowPrintText(text, delay)
Same as sAPI.printText, but you can set the delay between each character.
- sAPI.clearLine(y)
Clears the specified line.
- sAPI.setTextScale(scale)
Sets the scale on the entire screen.
Updates:
- sAPI.printText(text)
Now it tries dividing by spaces.
125 posts
Location
Chunk 0
Posted 10 November 2013 - 11:39 AM
I'm having trouble hooking this up.
How do you get the monitors id?