Page 1 of 1

how can im make input goes under last line of output ?

Posted: Mon May 01, 2023 12:48 pm
by hanicraft
im making a fantasy console but im want when user enters command it automaticly goes under output

heres what i tried so far

Code: Select all

function love.draw()
  local outputHeight = font:getHeight(output)
  love.graphics.print(output, 10, 10)
  love.graphics.print(input, 10, 20 + outputHeight)
end

Re: how can im make input goes under last line of output ?

Posted: Tue May 02, 2023 9:37 am
by Bobble68
Do you have any code other than this? It sounds like you also want a text input from typing, which isn't too hard but what you've shown is just a snippet.
If I'm understanding what you want exactly, my advice would be to have a string variable that you append the input to when when you press enter.