cettings
HTML setting inputs like for a game.
** Work in progress **
example
var settings = controls: forward: value: '<up>' type: 'bindkey' { return 'altered ' + val } container settings
api
var settings = require('cettings')(config)
config
is an object with the first level keys being the headings and second level is for fields. Each field accepts:
value
The value entered for the fieldtype
Either'bindkey'
to enable it to prompt for a key binding or'text'
for plain text.label
For a custom label.on
A callback function to alter the value.
settings.html()
Builds and returns the HTML for the settings:
controls forward
settings.on('set', key, val)
Called whenever a value has been set.
install
With npm do:
npm install cettings
Use browserify to require('cettings')
.
release history
- 0.1.0 - initial release
license
Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.