Change note impl
This commit is contained in:
parent
568a6c779c
commit
755f1889c4
2 changed files with 3 additions and 33 deletions
14
obj/note.lua
14
obj/note.lua
|
@ -6,16 +6,8 @@ local m = entity:from{
|
||||||
text = "sample text",
|
text = "sample text",
|
||||||
}
|
}
|
||||||
|
|
||||||
local install = m.install
|
m.mousepressed = window.mousepressed(function (self, x, y, button)
|
||||||
function m:install(room, x, y)
|
log:log("It reads:" .. self.text)
|
||||||
self.note = note:from{
|
end)
|
||||||
text = self.text,
|
|
||||||
room = room
|
|
||||||
}
|
|
||||||
|
|
||||||
install(self, room, x, y)
|
|
||||||
end
|
|
||||||
|
|
||||||
m.mousepressed = window.portal('note')
|
|
||||||
|
|
||||||
return m
|
return m
|
||||||
|
|
|
@ -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
|
|
Loading…
Add table
Reference in a new issue