タッチ位置の取得

love.touch.getPosition

追加バージョン0.10.0削除バージョン-

タッチした位置を取得します。

function love.draw()
  local touches = love.touch.getTouches()

  for i, id in ipairs(touches) do
    local x, y = love.touch.getPosition(id)
    love.graphics.print("X: " .. x .. ",Y: " .. y, 20, 20 * (i - 1))
  end
end
タッチ位置の取得