1
0
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:
2020-08-25 00:08:22 +02:00
parent 6a352faacb
commit 70a21731b9
2 changed files with 22 additions and 1 deletions

20
libGUI/openIMG.lua Normal file
View 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

View File

@@ -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",