function init_dialogue(ligne,x,l)
if player.x>=x and player.x<=x+l then
dialogue_init=true
dialogue_texte=ligne
end
end

dialogue_texte={}

function messageBox(n_ligne,ligne)
if dialogue_init==true then
local pic = Image.createEmpty(462,102)
pic:clear(Color.new(0,0,0,150))
pic:drawLine(0,0,462,0,Color.new(255,255,255))
pic:drawLine(0,0,0,102,Color.new(255,255,255))
pic:drawLine(461,0,461,102,Color.new(255,255,255))
pic:drawLine(0,101,462,101,Color.new(255,255,255))
for i=1,n_ligne do
pic:print(5,(i*20)+8,ligne[i],Color.new(255,255,255))
end
pic:print(450,88,"X",Color.new(255,255,255))


screen:blit(0,0,ecran)
screen.flip()
screen.waitVblankStart()
screen:blit(9,85,pic)
screen.flip()
screen.waitVblankStart()


pad = Controls.read()
while not(pad:cross()) do
pad = Controls.read()
System.sleep(200)
end
player.x=player.x+5
pic = nil 
collectgarbage()
end
end

