I'm making a game for mobile devices in which there is some kind of text input.
Everything works fine, but here's the thing: I'm using love.keyboard.setTextInput with the x, y, width and height parameters to make sure the text input field doesn't get covered by the keyboard. It seems to work when I first open the app, but as soon as I call love.keyboard.setTextInput(false) and then turn it back on, the keyboard seems to ignore the virtual bounds and covers the game.
Even more weird, it seems to work again when I quickly turn it on and off.
Here's the culprit:
Code: Select all
local bounds = {
x = 0,
y = love.graphics.getHeight() * .5,
width = love.graphics.getWidth(),
height = love.graphics.getHeight() * .5
}
love.keyboard.setTextInput(true, bounds.x, bounds.y, bounds.width, bounds.height)
Has this ever happened to you? Do you have any idea, or any workaround for it?
Thanks in advance for your help!