@next2d/events 3.5.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next2d/events",
3
- "version": "3.5.0",
3
+ "version": "3.7.0",
4
4
  "description": "Next2D Events Package",
5
5
  "author": "Toshiyuki Ienaga<ienaga@next2d.app> (https://github.com/ienaga/)",
6
6
  "license": "MIT",
@@ -0,0 +1,109 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * @description ゲームパッドによるユーザーの操作を示します。
4
+ * Indicates user operation via gamepad.
5
+ *
6
+ * @class
7
+ * @memberOf next2d.events
8
+ * @extends Event
9
+ */
10
+ export declare class GamepadEvent extends Event {
11
+ /**
12
+ * @description ゲームパッドのインデックス番号
13
+ * Index number of the gamepad
14
+ *
15
+ * @type {number}
16
+ * @default 0
17
+ * @public
18
+ */
19
+ gamepadIndex: number;
20
+ /**
21
+ * @description ボタンイベント時のボタン番号
22
+ * Button number at the time of button event
23
+ *
24
+ * @type {number | undefined}
25
+ * @default undefined
26
+ * @public
27
+ */
28
+ buttonIndex: number | undefined;
29
+ /**
30
+ * @description ボタンの押し具合 (0.0〜1.0)
31
+ * The degree of button press (0.0 to 1.0)
32
+ *
33
+ * @type {number | undefined}
34
+ * @default undefined
35
+ * @public
36
+ */
37
+ buttonValue: number | undefined;
38
+ /**
39
+ * @description 軸イベント時の軸番号
40
+ * Axis number at the time of axis event
41
+ *
42
+ * @type {number | undefined}
43
+ * @default undefined
44
+ * @public
45
+ */
46
+ axisIndex: number | undefined;
47
+ /**
48
+ * @description 軸の値 (-1.0〜1.0)
49
+ * Axis value (-1.0 to 1.0)
50
+ *
51
+ * @type {number | undefined}
52
+ * @default undefined
53
+ * @public
54
+ */
55
+ axisValue: number | undefined;
56
+ /**
57
+ * @param {string} type
58
+ * @param {boolean} [bubbles=true]
59
+ *
60
+ * @constructor
61
+ * @public
62
+ */
63
+ constructor(type: string, bubbles?: boolean);
64
+ /**
65
+ * @description ゲームパッドが接続されたときに発生します。
66
+ * Occurs when a gamepad is connected.
67
+ *
68
+ * @return {string}
69
+ * @const
70
+ * @static
71
+ */
72
+ static get GAMEPAD_CONNECTED(): string;
73
+ /**
74
+ * @description ゲームパッドが切断されたときに発生します。
75
+ * Occurs when a gamepad is disconnected.
76
+ *
77
+ * @return {string}
78
+ * @const
79
+ * @static
80
+ */
81
+ static get GAMEPAD_DISCONNECTED(): string;
82
+ /**
83
+ * @description ゲームパッドのボタンが押されたときに発生します。
84
+ * Occurs when a gamepad button is pressed.
85
+ *
86
+ * @return {string}
87
+ * @const
88
+ * @static
89
+ */
90
+ static get BUTTON_DOWN(): string;
91
+ /**
92
+ * @description ゲームパッドのボタンが離されたときに発生します。
93
+ * Occurs when a gamepad button is released.
94
+ *
95
+ * @return {string}
96
+ * @const
97
+ * @static
98
+ */
99
+ static get BUTTON_UP(): string;
100
+ /**
101
+ * @description ゲームパッドのスティック(軸)が変化したときに発生します。
102
+ * Occurs when a gamepad stick (axis) changes.
103
+ *
104
+ * @return {string}
105
+ * @const
106
+ * @static
107
+ */
108
+ static get AXES_MOTION(): string;
109
+ }
@@ -0,0 +1,151 @@
1
+ import { Event } from "./Event";
2
+ /**
3
+ * @description ゲームパッドによるユーザーの操作を示します。
4
+ * Indicates user operation via gamepad.
5
+ *
6
+ * @class
7
+ * @memberOf next2d.events
8
+ * @extends Event
9
+ */
10
+ export class GamepadEvent extends Event {
11
+ /**
12
+ * @param {string} type
13
+ * @param {boolean} [bubbles=true]
14
+ *
15
+ * @constructor
16
+ * @public
17
+ */
18
+ constructor(type, bubbles = true) {
19
+ super(type, bubbles);
20
+ /**
21
+ * @description ゲームパッドのインデックス番号
22
+ * Index number of the gamepad
23
+ *
24
+ * @type {number}
25
+ * @default 0
26
+ * @public
27
+ */
28
+ Object.defineProperty(this, "gamepadIndex", {
29
+ enumerable: true,
30
+ configurable: true,
31
+ writable: true,
32
+ value: void 0
33
+ });
34
+ /**
35
+ * @description ボタンイベント時のボタン番号
36
+ * Button number at the time of button event
37
+ *
38
+ * @type {number | undefined}
39
+ * @default undefined
40
+ * @public
41
+ */
42
+ Object.defineProperty(this, "buttonIndex", {
43
+ enumerable: true,
44
+ configurable: true,
45
+ writable: true,
46
+ value: void 0
47
+ });
48
+ /**
49
+ * @description ボタンの押し具合 (0.0〜1.0)
50
+ * The degree of button press (0.0 to 1.0)
51
+ *
52
+ * @type {number | undefined}
53
+ * @default undefined
54
+ * @public
55
+ */
56
+ Object.defineProperty(this, "buttonValue", {
57
+ enumerable: true,
58
+ configurable: true,
59
+ writable: true,
60
+ value: void 0
61
+ });
62
+ /**
63
+ * @description 軸イベント時の軸番号
64
+ * Axis number at the time of axis event
65
+ *
66
+ * @type {number | undefined}
67
+ * @default undefined
68
+ * @public
69
+ */
70
+ Object.defineProperty(this, "axisIndex", {
71
+ enumerable: true,
72
+ configurable: true,
73
+ writable: true,
74
+ value: void 0
75
+ });
76
+ /**
77
+ * @description 軸の値 (-1.0〜1.0)
78
+ * Axis value (-1.0 to 1.0)
79
+ *
80
+ * @type {number | undefined}
81
+ * @default undefined
82
+ * @public
83
+ */
84
+ Object.defineProperty(this, "axisValue", {
85
+ enumerable: true,
86
+ configurable: true,
87
+ writable: true,
88
+ value: void 0
89
+ });
90
+ this.gamepadIndex = 0;
91
+ this.buttonIndex = undefined;
92
+ this.buttonValue = undefined;
93
+ this.axisIndex = undefined;
94
+ this.axisValue = undefined;
95
+ }
96
+ /**
97
+ * @description ゲームパッドが接続されたときに発生します。
98
+ * Occurs when a gamepad is connected.
99
+ *
100
+ * @return {string}
101
+ * @const
102
+ * @static
103
+ */
104
+ static get GAMEPAD_CONNECTED() {
105
+ return "gamepadconnected";
106
+ }
107
+ /**
108
+ * @description ゲームパッドが切断されたときに発生します。
109
+ * Occurs when a gamepad is disconnected.
110
+ *
111
+ * @return {string}
112
+ * @const
113
+ * @static
114
+ */
115
+ static get GAMEPAD_DISCONNECTED() {
116
+ return "gamepaddisconnected";
117
+ }
118
+ /**
119
+ * @description ゲームパッドのボタンが押されたときに発生します。
120
+ * Occurs when a gamepad button is pressed.
121
+ *
122
+ * @return {string}
123
+ * @const
124
+ * @static
125
+ */
126
+ static get BUTTON_DOWN() {
127
+ return "gamepadbuttondown";
128
+ }
129
+ /**
130
+ * @description ゲームパッドのボタンが離されたときに発生します。
131
+ * Occurs when a gamepad button is released.
132
+ *
133
+ * @return {string}
134
+ * @const
135
+ * @static
136
+ */
137
+ static get BUTTON_UP() {
138
+ return "gamepadbuttonup";
139
+ }
140
+ /**
141
+ * @description ゲームパッドのスティック(軸)が変化したときに発生します。
142
+ * Occurs when a gamepad stick (axis) changes.
143
+ *
144
+ * @return {string}
145
+ * @const
146
+ * @static
147
+ */
148
+ static get AXES_MOTION() {
149
+ return "gamepadaxesmotion";
150
+ }
151
+ }
package/src/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "./Event";
2
2
  export * from "./EventDispatcher";
3
3
  export * from "./EventPhase";
4
4
  export * from "./FocusEvent";
5
+ export * from "./GamepadEvent";
5
6
  export * from "./HTTPStatusEvent";
6
7
  export * from "./IOErrorEvent";
7
8
  export * from "./PointerEvent";
package/src/index.js CHANGED
@@ -2,6 +2,7 @@ export * from "./Event";
2
2
  export * from "./EventDispatcher";
3
3
  export * from "./EventPhase";
4
4
  export * from "./FocusEvent";
5
+ export * from "./GamepadEvent";
5
6
  export * from "./HTTPStatusEvent";
6
7
  export * from "./IOErrorEvent";
7
8
  export * from "./PointerEvent";