A level editor for my unnamed-platformer project. https://gitea.planet-casio.com/KikooDX/unnamed-platformer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
up-editor/draw.lua

32 lines
779 B

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