How to use Multidisplays
ScrapComputers has a multidisplay system, however it can be quite complicated on how to use them. This guide would help you how to use them.
Notes
When me mean grids like 5x3
or 4x4
, we mean like the first number being the amount of displays horizontally and the second number being the amount of displays vertically.
So a 4x4
grid would be this:
Each coordinate being a display. 4 on the horizontal axis, 4 on the vertical axis. Hence a 4x4
grid of displays.
Placing the displays & Connecting them
We first have to place our displays, you have to choose 1 display size & 1 display resolution. Multi-display's do not support variant resolutions and using multiple display sizes would make it look weird.
In a perfect world, you can just connect the displays to the computer, write some code and it would work automaticly however we don't live in that world since that would complicated things alot and making the multi-displays draw pixels on to the screen already takes a chunk of math so we wil have to connect them in a order.
The order is left to right, top to bottom. Meaning if you let's say have a 4x4
grid of displays, your order of connecting them should be this:
Multi-displays only work in display grids that are rectangles or squares, shapes like circles, triangles and etc don't work with multi-displays
Writing the code for it
We now have to write a literal line of code to make this work. get the amount of displays on the horizontal and vertical axis and put them here.
Formula
local display = sc.multidisplay.new( sc.getDisplays(), columns, rows )
For a 4x4, 5x3 & a 2x8. It would look like this:
--- 4x4
local display = sc.multidisplay.new( sc.getDisplays(), 4, 4 )
--- 5x3
local display = sc.multidisplay.new( sc.getDisplays(), 5, 3 )
--- 2x8
local display = sc.multidisplay.new( sc.getDisplays(), 2, 8 )
After this, you can use the display table like a normal display, you can now use the multi-display in your project