tiles can be drawn now
This commit is contained in:
1 parent
a96b58adf2
commit
68d9bec872
6 files changed
+32
No files matched your search
@@ -3,6 +3,7 @@ local utility = require "lib.utility"
|
||||
local constants = {
|
||||
progress_bar_height = 30,
|
||||
reading_time_multiplier = 1 / 9,
|
||||
tile_size = 32,
|
||||
}
|
||||
|
||||
constants.fix_stats_tasks = function(data)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
local constants = require "data.constants"
|
||||
local utility = require "lib.utility"
|
||||
|
||||
local file = io.open("./assets/tileset.png", "rb")
|
||||
local raw_data = file:read("*all")
|
||||
file:close()
|
||||
|
||||
local file_data = love.filesystem.newFileData(raw_data, "./assets/tileset.png")
|
||||
local love_image = love.graphics.newImage(file_data)
|
||||
|
||||
local tile_data = utility.load_data("./assets/images.json")
|
||||
|
||||
local images = {
|
||||
love_image = love_image,
|
||||
}
|
||||
|
||||
for name, data in pairs(tile_data) do
|
||||
images[name] = love.graphics.newQuad( (data.x - 1) * constants.tile_size, (data.y - 1) * constants.tile_size, constants.tile_size, constants.tile_size, love_image )
|
||||
end
|
||||
|
||||
return images
|
||||
Reference in new issue
Block a user