load_image function

This commit is contained in:
tangent committed 2026-10-29 16:56:18 -06:00
1 parent d5e8c389bd
commit 309b5abef5
1 file changed
+8
+8
View File
@@ -0,0 +1,8 @@
local load_image = function(file_path)
local file = io.open(file_path, "rb")
local raw_data = file:read("*all")
file:close()
local love_file_data = love.filesystem.newFileData(raw_data, file_path)
local love_image = love.graphics.newImage(love_file_data)
return love_image
end