Why didn't your script work?
- With an image you can make a single draw call and it will stay there until you turn it off.
- With "text", the call needs to be made repeatedly to keep the text on screen.
So we need to structure it differently. Again I've separated process (getting the E) and the talk itself. I also added a "bonus" prompt... )
Note, your panels are off and I did not correct them but now you'll be able to see them and make your own adjustments.
Incidentally - you want text in the middle?
Use
TextCenterOnX(50,50,1,"My text here")
If you want color center use
r= 255
g =255
b=255
TextCenterOnXColor(50,50,1,"My text here",r,g,b)
Enjoy...
function textbox_init(e)
textbox_pressed = 0
talking = 0
end
function textbox_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 150 and g_PlayerHealth > 0 then
if talking == 0 then
Prompt ( "Press E to talk" )
else
Prompt ( "Press E to stop talking" )
end
if GetInKey() == "e" and textbox_pressed == 0 then
if talking == 1 then
talking = 0
else
talking = 1
end
textbox_pressed = 1
end
if talking == 1 then
Text(50,50,1,"Hello World")
Text(50,70,1,"Hello World2")
Panel(10,10,20,20)
Panel(60,60,80,80)
TextCenterOnX(50,90,4,"Hello World3")
end
end
if GetInKey() == "" then
textbox_pressed = 0
end
end
AKA SisterMatic (Steam)
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD