mirror of
https://github.com/AR2000AR/openComputers_codes.git
synced 2025-09-08 14:41:14 +02:00
add opnIMG.lua tool
This commit is contained in:
20
libGUI/openIMG.lua
Normal file
20
libGUI/openIMG.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
local shell = require("shell")
|
||||
local term = require("term")
|
||||
local fs = require("filesystem")
|
||||
local libgui = require("libgui")
|
||||
local gpu = require("component").gpu
|
||||
|
||||
local args,opts = shell.parse(...)
|
||||
|
||||
if(fs.exists(args[1]) and not fs.isDirectory(args[1])) then
|
||||
local bk = gpu.getBackground()
|
||||
gpu.setBackground(tonumber(args[2],16) or bk)
|
||||
term.clear()
|
||||
libgui.drawImg(libgui.openPAM(args[1]),1,1)
|
||||
os.sleep(1)
|
||||
require("event").pull("key_down")
|
||||
gpu.setBackground(bk)
|
||||
term.clear()
|
||||
else
|
||||
print("Not a file")
|
||||
end
|
@@ -46,7 +46,8 @@
|
||||
},
|
||||
["libgui"] = {
|
||||
files = {
|
||||
["master/libGUI/libgui.lua"] = "/lib"
|
||||
["master/libGUI/libgui.lua"] = "/lib",
|
||||
["master/libGUI/openIMG.lua"] = "/bin"
|
||||
},
|
||||
name = "libGUI",
|
||||
description = "library used to create gui \n The library can load \"pam\" images",
|
||||
|
Reference in New Issue
Block a user