[NEW] Moguts els dialegs a trigger per event
This commit is contained in:
@@ -2,29 +2,29 @@ dialeg={
|
||||
list = {},
|
||||
}
|
||||
|
||||
dialegs = {}
|
||||
-- dialegs = {}
|
||||
|
||||
function dialeg.update()
|
||||
for i,d in ipairs(dialegs) do
|
||||
if distancia(d.actor1, d.actor2, d.direccio)<=d.distancia and d.enabled then
|
||||
dialeg.new(d.text, d.actor1)
|
||||
d.enabled=false
|
||||
end
|
||||
end
|
||||
end
|
||||
-- function dialeg.update()
|
||||
-- for i,d in ipairs(dialegs) do
|
||||
-- if distancia(d.actor1, d.actor2, d.direccio)<=d.distancia and d.enabled then
|
||||
-- dialeg.new(d.text, d.actor1)
|
||||
-- d.enabled=false
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
function dialeg.new( _text, _actor )
|
||||
print(_text)
|
||||
table.insert(
|
||||
dialeg.list,
|
||||
{
|
||||
actor= _actor,
|
||||
text=_text,
|
||||
time = 120,
|
||||
w = math.floor(4.6*#_text),
|
||||
h = 20,
|
||||
} )
|
||||
end
|
||||
-- function dialeg.new( _text, _actor )
|
||||
-- print(_text)
|
||||
-- table.insert(
|
||||
-- dialeg.list,
|
||||
-- {
|
||||
-- actor= _actor,
|
||||
-- text=_text,
|
||||
-- time = 120,
|
||||
-- w = math.floor(4.6*#_text),
|
||||
-- h = 20,
|
||||
-- } )
|
||||
-- end
|
||||
|
||||
function dialeg.draw( )
|
||||
local i = 1
|
||||
|
||||
Reference in New Issue
Block a user