diff --git a/data/editor.lua b/data/editor.lua index 36c88a9..29fbd53 100644 --- a/data/editor.lua +++ b/data/editor.lua @@ -42,6 +42,30 @@ editor={ editor.paused=true editor.show_menu() end + if btnp(KEY_TAB) then + update=editor.update_tileset + end + end + end, + + update_tileset=function() + cls() + sspr(0,0,128,128,0,0) + + local mx,my=mousex(),mousey() + local tx,ty=mx>>3,my>>3 + local rx,ry=tx<<3,ty<<3 + rect(rx-1, ry-1, rx+8, ry+8, 10) + + if btnp(KEY_TAB) or btnp(KEY_ESCAPE) then + update=editor.update + end + + if mbtnp(1) then + if tx<16 and ty<16 then + editor.selected_tile=ty*16+tx + end + update=editor.update end end,