Change note impl

This commit is contained in:
백현웅 2025-01-14 19:36:39 +09:00
parent 568a6c779c
commit 755f1889c4
2 changed files with 3 additions and 33 deletions

View file

@ -6,16 +6,8 @@ local m = entity:from{
text = "sample text",
}
local install = m.install
function m:install(room, x, y)
self.note = note:from{
text = self.text,
room = room
}
install(self, room, x, y)
end
m.mousepressed = window.portal('note')
m.mousepressed = window.mousepressed(function (self, x, y, button)
log:log("It reads:" .. self.text)
end)
return m

View file

@ -1,22 +0,0 @@
local window = require("window")
local room = require("room")
local edge = require("edge")
local m = room:new()
local from = m.from
function m:from(t)
local n = from(self, t)
edge.set(n, 'down', n.room)
return n
end
m.draw = window.draw(function (self)
love.graphics.printf(self.text, 80, 40, 160)
self.edges[1]:draw()
end)
return m