Add pad.press
24
pad.press.md
Normal file
24
pad.press.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# pad.press()
|
||||||
|
Retorna quin botó del gamepad acaba de ser premut.
|
||||||
|
|
||||||
|
# pad.press(btn)
|
||||||
|
Retorna si el botó especificat acaba de ser premut.
|
||||||
|
|
||||||
|
### Paràmetres
|
||||||
|
* btn — Número del botó (només en la versió amb paràmetre).
|
||||||
|
|
||||||
|
### Torna
|
||||||
|
* Sense paràmetres: el número del botó premut.
|
||||||
|
* Amb paràmetre: un booleà indicant si s’ha produït el “press”.
|
||||||
|
|
||||||
|
### Exemple
|
||||||
|
```
|
||||||
|
local b = pad.press()
|
||||||
|
if pad.press(pad.UP) then
|
||||||
|
print("Botó amunt premut")
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
### Vore també
|
||||||
|
* [pad.down](pad.down)
|
||||||
|
* [pad.any](pad.any)
|
||||||
Reference in New Issue
Block a user