Skip to content

Commit

Permalink
adding example ktg.setup to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ericoporto committed Dec 14, 2016
1 parent 7074b67 commit 1e4833f
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,31 @@ The possible keys by default are:
ktg.key.BUTTONX
ktg.key.BUTTONY
}

## ktg.setup details

ktg.setup accepts two parameters:

- `autoupdategamepad` : set this to `false` if you want to place your gamepad
update in your own loop, to ensure better precision. You will need to manually
- `autoupdategamepad` : set this to `false` if you want to place your gamepad
update in your own loop, to ensure better precision. You will need to manually
call ktg.updateGamepad(). Default is `true`.
- `drawtouch` : set to `false`if you don't need the touch input functionality,

- `drawtouch` : set to `false`if you don't need the touch input functionality,
for example, if you detect that your game is in a desktop. Default is `true`.

Ex:

`ktg.setup(true, true)`

is the same as

`ktg.setup()`

## ktg.resize details

In case your game resizes, for example, by resizing the browser window, or going
fullscreen, you will need to deal with this. When you deal, just ensure to call
ktg.resize() to guarantee it will resize the touch input appropriately.
`ktg.resize()` to guarantee it will resize the touch input appropriately.

![](screenshot.png)

Expand Down

0 comments on commit 1e4833f

Please sign in to comment.