Angular-Kaospad

A two-dimensional input-controller for Angular.
0 people use it

Angular-Kaospad

Angular-Kaospad is a two-dimensional input-controller. To see it in action view the demo:

The Demo


Installation

Download this repo, unzip the contents and put the CSS- and the JS-file into your page.

Usage

First, inject the ek.kaospad-module in your app's module declaration.

angular.module('yourApp', [ek.kaospad]);

After that, insert the directive into your template.

That's it!

The current value of the Kaospad ({x: …, y: …}) is exposed on the ng-model.

Options

There are two options:

range-x

Determines the horizontal range of the kaospad by defining the edge length of a quadrant. This means, that a value of 100 leads to an actual range of 200 => [-100, 100].

range-y

Determines the vertical range of the kaospad by defining the edge length of a quadrant. This means, that a value of 100 leads to an actual range of 200 => [-100, 100].

Author

Emanuel Kluge

Emanuel Kluge

Website

twitter

Google+

License

Copyright (c) 2014 Emanuel Kluge

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

comments powered by Disqus
This page was last updated over 3 years ago.