一个模块,用于将通过触摸屏或鼠标等各种输入设备输入的用户操作信息转换为逻辑虚拟坐标。
@egjs/axes
Demo / Documentation / Other components
You can easily create a UI that responds to user actions.
$ npm install @egjs/axesvar Axes = eg.Axes;
var PanInput = Axes.PanInput;
var PinchInput = Axes.PinchInput;
var WheelInput = Axes.WheelInput;
var MoveKeyInput = Axes.MoveKeyInput;import Axes, {PanInput, PinchInput, WheelInput, MoveKeyInput} from "@egjs/axes";// create eg.Axes with option
const axes = new Axes({
something1: { range: [0, 100] },
something2: { range: [0, 100] },
somethingN: { range: [-200, 200] }
});axes.on({
"change": evt => /* ... */
});const panInput = new PanInput("#area");
const wheelInput = new WheelInput("#wArea");
const pinchInput = new PinchInput("#pArea");
const movekeyInput = new MoveKeyInput("#mArea");axes.connect(["something2", "somethingN"], panInput);
axes.connect(["something1"], wheelInput);
axes.connect(["something2"], pinchInput);
axes.connect(["something1", "something2"], movekeyInput);You can change the value of the axis through touch screen, mouse or anything else.
| 10+ | Latest | Latest | Latest | 7+ | 2.3+(except 3.x) |
egjs-axes has the dependencies for the following libraries:
| eg.Component | eg.Agent |
|---|---|
| 3.0.1+ | 2.2.1+ |
Check our Demos.
See Documentation page.
See CONTRIBUTING.md.
Please file an Issue.
@egjs/axes is released under the MIT license.
…
暂无开放 Issues,或尚未同步最近议题。