love.touch.getPosition (Italiano)
Disponibile da LÖVE 0.10.0 |
Questa/o function non è supportata/o nelle versioni precedenti. |
Restituisce la posizione di uno specifico tap, in pixel.
Contents
Funzione
Sintesi
x, y = love.touch.getPosition( id )
Parametri
light userdata (Italiano) id
- L'identificativo di un tap. Usa love.touch.getTouches, love.touchpressed, oppure love.touchmoved per ottenere un tap id.
Cosa ritorna
number (Italiano) x
- La posizione x del tap all'interno della finestra corrente, in pixel.
number (Italiano) y
- La posizione y del tap all'interno della finestra corrente, in pixel.
Note
Il porting non ufficiale di LÖVE 0.9.2 su Android e iOS restituisce valori normalizzati nel range [0, 1], mentre queste API restituiscono valori in pixel.
Esempi
Disegna un cerchio in ogni punto in cui il touchscreen è toccato
function love.draw()
local touches = love.touch.getTouches()
for i, id in ipairs(touches) do
local x, y = love.touch.getPosition(id)
love.graphics.circle("fill", x, y, 20)
end
end
Vedi anche
- love.touch (Italiano)
- love.touch.getTouches (Italiano)
- love.touchpressed (Italiano)
- love.touchreleased (Italiano)
In altre lingue
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info