load_image function
This commit is contained in:
1 parent
d5e8c389bd
commit
309b5abef5
1 file changed
+8
@@ -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
|
||||
Reference in new issue
Block a user