View Single Post
Old 12-21-2018, 07:19 AM   #17
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 301
Default No Joy with Images in LS GUI lib

I've gone back over and over and over this and have added the code below to my script before Main(). Still no background image. I just don't understand enough here to figure out what's going wrong.

Code:
GUI.images = {
	bg = "C:\\OneDriveTemp\\OneDrive\\Media Ministry\\bg.jpg",
	logo = "C:\\OneDriveTemp\\OneDrive\\Media Ministry\\Logo 192x93.png",
}
-- Load all our images into buffers
local function load_images()
	local info = debug.getinfo(1,'S')
	script_path = info.source:match[[^@?(.*[\/])[^\/]-$]]
	local idx = 0
	for key, file in pairs(GUI.images) do
		retval = gfx.loadimg(idx, script_path..file)
		GUI.images[key] = idx
		idx = idx + 1
	end
end
GUI.load_images = load_images

-- Draw the specified frame from a given image buffer
local function img(x, y, w, h, step, buffer)
	gfx.mode = 0
	local img_y = h * GUI.round(step)
	gfx.blit(buffer, 1, 0, 0, img_y, w, h, x, y, w, h)
end
GUI.img = img

GUI.img(0, 0, GUI.w, GUI.h, 0, GUI.images.bg)
-- GUI.img(5, 5, 192, 93, 0, GUI.images.logo)

local function Main()
I'm trying to use the image below as the background (bg).

__________________
"But be ye doers of the word, and not hearers only, deceiving your own selves."
tXShooter is offline   Reply With Quote