-[NEW] Ara es poden reloadar les textures des de l'editor amb F11

- [FIX] No es podia tilepickar quan editaves el tilemap de fondo
- Habitacions, tiles...
This commit is contained in:
2025-06-25 13:56:08 +02:00
parent fd2d3476c1
commit e456f0f781
5 changed files with 15 additions and 1 deletions

View File

@@ -91,10 +91,17 @@ editor = {
sprites.hero.pos.y = ty*8-9
elseif key.press(key.F9) then
editor.play()
elseif key.press(key.F11 ) then
reload_textures()
end
end,
create_stamp=function()
if editor.layer == LAYER_FOREGROUND then
map.surf(rooms.surf_foreground)
elseif editor.layer == LAYER_BACKGROUND then
map.surf(rooms.surf_background)
end
local tx1,ty1,tx2,ty2=editor.selection.x1,editor.selection.y1,editor.selection.x2,editor.selection.y2
if tx1>tx2 then tx1,tx2=tx2,tx1 end
if ty1>ty2 then ty1,ty2=ty2,ty1 end

View File

@@ -4,10 +4,17 @@ require "rooms"
require "editor"
require "game"
function mini.init()
function reload_textures()
if surf_sprites then surf.free(surf_sprites) end
surf_sprites = surf.load("sprites.gif")
if surf_tiles then surf.free(surf_tiles) end
surf_tiles = surf.load("tiles.gif")
pal.set(pal.load("tiles.gif"))
end
function mini.init()
reload_textures()
pal.trans(0)
rooms.init()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 921 B

After

Width:  |  Height:  |  Size: 960 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB