displays allow you to display information
in SComputers, displays have the best optimization of all mods in the workshop
the colors for the display can be specified in the following formats: 0xRRGGBB, "rrggbb", "#rrggbb", sm.color.new(r, g, b)
indexing of the display starts from 0 and up to width/height - 1. however, if you "go beyond the margins" nothing happens, all content that goes beyond the boundaries of the display simply will not be rendered
if you do not have enough variety of sizes and resolutions of displays presented in the basic mod, you can use the "stretchable display" addon
note that if the color is not specified (nil), then all rendering methods will perceive it as white, except clear, which perceives nil as black
please note that the display renders the image using effects. and a large number of effects cause LAGS. despite the best optimization of displays in the workshop at the moment, displays still cause lags due to effects. you can use display.setOptimizationLevel(0-255) to set how similar colors the display can combine. The default value is 16. 0 is a perfect picture and 256 is a very bad picture. For the most part, this optimization only makes sense when using cameras
attention. if your display usage scenario does not involve rendering a full-color image, then it is better to disable optimization using: display.setOptimizationLevel(0) (this way the display will work faster)
component name - display


list of materials for the display (can be setted using display.setMaterial):


methods:


only for holographic/world/unrestricted displays:

            --ellipse example
local display = getComponent("display")
display.reset()
local rx, ry = display.getSize()

display.clear()
display.fillEllipse(16, 16, rx - 32, ry - 32, 15, 0xff0000)
display.drawEllipse(16, 16, rx - 32, ry - 32, 15, 0xff00ff)
display.flush()

function callback_loop()
    if _endtick then
        display.clear()
        display.flush()
    end
end
        
            --example for display 256x256
--full fonts list: https://igorkll.github.io/fonts.html

local fonts = require("fonts")
local display = getComponent("display")

display.reset()
display.setTextSpacing(6) --in such large fonts, it would be more logical to spread the characters a little more than 1 pixel apart
display.setFontScale(1.8, 1.8) --is 32x32 small? you can make any font bigger!
display.clear()
local posY = 1
local text = "TEST"

display.setFont(fonts.impact_32)
local boxX, boxY = display.calcTextBox(text)
display.fillRect(1, posY, boxX, boxY, 0x00ff00)
display.drawText(1, posY, text, 0xff0000)
posY = posY + display.getFontHeight() + 3

display.setFont(fonts.verdana_32)
local boxX, boxY = display.calcTextBox(text)
display.fillRect(1, posY, boxX, boxY, 0x00ff00)
display.drawText(1, posY, text, 0xff0000)
posY = posY + display.getFontHeight() + 3

display.setFont(fonts.seguibl_32)
local boxX, boxY = display.calcTextBox(text)
display.fillRect(1, posY, boxX, boxY, 0x00ff00)
display.drawText(1, posY, text, 0xff0000)
posY = posY + display.getFontHeight() + 3

display.setFont(fonts.arial_32)
local boxX, boxY = display.calcTextBox(text)
display.fillRect(1, posY, boxX, boxY, 0x00ff00)
display.drawText(1, posY, text, 0xff0000)
posY = posY + display.getFontHeight() + 3

display.flush()

function callback_loop()
    if _endtick then
        display.clear()
        display.flush()
        return
    end
end
        
            local display = getComponents("display")[1]

display.reset()
display.clear()
display.setFont(
    {
        width = 3,
        height = 3,
        chars = {
            error = {
                "111",
                "1.1",
                "111"
            },
            a = {
                ".1.",
                "111",
                "1.1"
            },
            b = {
                "1..",
                "111",
                "111"
            },
            c = {
                "111",
                "1..",
                "111"
            }
        }
    }
)
display.setFontSize(6, 12)
local boxX, boxY = display.calcTextBox("abcdef")
display.fillRect(1, 1, boxX, boxY, 0x00ff00)
display.drawText(1, 1, "abcdef", "ff0000")
display.flush()

function callback_loop()
    if _endtick then
        display.clear()
        display.forceFlush()
    end
end