Update 'btn'

2021-12-07 13:59:59 +01:00
parent 23f8cf05a5
commit 27cfe39225

23
btn.md

@@ -4,6 +4,29 @@ Aquesta funció torna `true` o `false` segons la tecla que s'especifica com a pa
`tecla`
Una de les [constants](teclat) asociades al teclat.
### Exemple
```
function init()
x,y = 10,7
setmode(2)
end
function update()
cls()
if btn(KEY_UP) then
y = mid(0,y-1,14)
elseif btn(KEY_DOWN) then
y = mid(0,y+1,14)
end
if btn(KEY_LEFT) then
x = mid(0,x-1,19)
elseif btn(KEY_RIGHT) then
x = mid(0,x+1,19)
end
color(COLOR_YELLOW,COLOR_BLACK)
print("\224", x, y)
end
```
### Vore també
* [btnp(tecla)](btnp)
* [Constants de teclat](teclat)