mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 02:39:48 -04:00
lua program to change screen resolution
This commit is contained in:
parent
40755b9279
commit
e837c43cf6
22
assets/opencomputers/lua/rom/bin/resolution.lua
Normal file
22
assets/opencomputers/lua/rom/bin/resolution.lua
Normal file
@ -0,0 +1,22 @@
|
||||
local args = shell.parse(...)
|
||||
if #args == 0 then
|
||||
print(component.gpu.getResolution())
|
||||
return
|
||||
end
|
||||
|
||||
if #args < 2 then
|
||||
print("Usage: resolution [<width> <height>]")
|
||||
return
|
||||
end
|
||||
|
||||
local w = tonumber(args[1])
|
||||
local h = tonumber(args[2])
|
||||
if not w or not h then
|
||||
print("invalid width or height")
|
||||
return
|
||||
end
|
||||
|
||||
local result, reason = component.gpu.setResolution(w, h)
|
||||
if not result then
|
||||
print(reason)
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user