33 lines
779 B
Lua
33 lines
779 B
Lua
function love.draw()
|
|
love.graphics.push()
|
|
love.graphics.scale(scale)
|
|
--draw screen
|
|
love.graphics.setColor(1, 1, 1, 1)
|
|
x = 0
|
|
y = 0
|
|
for i = 1, SCREEN_LEN, 1 do
|
|
current_tile = selected_screen:sub(i, i)
|
|
tile_id = 0
|
|
for i, v in ipairs(tiles_char) do
|
|
if v == current_tile then tile_id = i break end
|
|
end
|
|
if tiles[tile_id] then
|
|
love.graphics.draw(tiles[tile_id], x, y)
|
|
end
|
|
x = x + 16
|
|
if x > 16 * 25 then
|
|
x = 0
|
|
y = y + 16
|
|
end
|
|
end
|
|
--draw preview
|
|
love.graphics.setColor(1, 1, 1, 0.5)
|
|
if tiles[selected_tile] then
|
|
love.graphics.draw(tiles[selected_tile], clip_mouse_x, clip_mouse_y)
|
|
end
|
|
--gui
|
|
love.graphics.pop()
|
|
love.graphics.setColor(0.8, 0.8, 0.8, 1)
|
|
love.graphics.print(screen_id, 2, 0)
|
|
end
|