gaesup-world 0.6.62 → 0.6.72
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/README.md +17 -17
- package/dist/gaesup/gaesupProps/index.js +1 -1
- package/dist/gaesup/hooks/useClicker/index.d.ts +1 -1
- package/dist/gaesup/hooks/useClicker/index.js +1 -1
- package/dist/gaesup/hooks/useJoyStick/index.d.ts +2 -2
- package/dist/gaesup/hooks/useJoyStick/index.js +1 -1
- package/dist/gaesup/physics/character/direction.d.ts +1 -1
- package/dist/gaesup/tools/joystick/index.d.ts +3 -0
- package/dist/gaesup/tools/{joyStick → joystick}/index.js +1 -1
- package/dist/gaesup/tools/{joyStick → joystick}/style.css +3 -3
- package/dist/gaesup/tools/{joyStick → joystick}/type.d.ts +4 -0
- package/dist/gaesup/world/context/reducer.d.ts +1 -1
- package/dist/gaesup/world/context/type.d.ts +1 -1
- package/dist/gaesup/world/initalize/index.d.ts +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.js +5 -6
- package/index.ts +1 -2
- package/package.json +1 -1
- package/dist/gaesup/tools/joyStick/index.d.ts +0 -6
- /package/dist/gaesup/tools/{gameBoy → gameboy}/GameBoyButton.d.ts +0 -0
- /package/dist/gaesup/tools/{gameBoy → gameboy}/GameBoyButton.js +0 -0
- /package/dist/gaesup/tools/{gameBoy → gameboy}/index.d.ts +0 -0
- /package/dist/gaesup/tools/{gameBoy → gameboy}/index.js +0 -0
- /package/dist/gaesup/tools/{gameBoy → gameboy}/style.css +0 -0
- /package/dist/gaesup/tools/{gameBoy → gameboy}/type.d.ts +0 -0
- /package/dist/gaesup/tools/{gameBoy → gameboy}/type.js +0 -0
- /package/dist/gaesup/tools/{gamePad → gamepad}/GamePadButton.d.ts +0 -0
- /package/dist/gaesup/tools/{gamePad → gamepad}/GamePadButton.js +0 -0
- /package/dist/gaesup/tools/{gamePad → gamepad}/index.d.ts +0 -0
- /package/dist/gaesup/tools/{gamePad → gamepad}/index.js +0 -0
- /package/dist/gaesup/tools/{gamePad → gamepad}/style.css +0 -0
- /package/dist/gaesup/tools/{gamePad → gamepad}/type.d.ts +0 -0
- /package/dist/gaesup/tools/{gamePad → gamepad}/type.js +0 -0
- /package/dist/gaesup/tools/{joyStick → joystick}/type.js +0 -0
package/README.md
CHANGED
|
@@ -89,7 +89,7 @@ This project is distributed under the MIT License.
|
|
|
89
89
|
|
|
90
90
|
* ## 5. [Tools](#Tools)
|
|
91
91
|
|
|
92
|
-
- [
|
|
92
|
+
- [joystick](#1joystick)
|
|
93
93
|
|
|
94
94
|
* [keyBoardTooltip](#keyBoardTooltip)
|
|
95
95
|
|
|
@@ -123,7 +123,7 @@ This is the character control in Gaesup World.
|
|
|
123
123
|
| Name | Condition | Info |
|
|
124
124
|
| -------- | --------------------------- | ----------------------------------------------------------------------- |
|
|
125
125
|
| Keyboard | desktop | A standard keyboard tool. You can see where on the keyboard is clicked. |
|
|
126
|
-
|
|
|
126
|
+
| joystick | mobile (not normal control) | A joystick implementation tool. It works on mobile devices. |
|
|
127
127
|
| Gameboy | mobile | A Gameboy implementation tool. It works on mobile devices. |
|
|
128
128
|
|
|
129
129
|
## Vehicle
|
|
@@ -141,7 +141,7 @@ This is the character control in Gaesup World.
|
|
|
141
141
|
| Name | Condition | Info |
|
|
142
142
|
| -------- | --------- | ----------------------------------------------------------------------- |
|
|
143
143
|
| Keyboard | desktop | A standard keyboard tool. You can see where on the keyboard is clicked. |
|
|
144
|
-
|
|
|
144
|
+
| joystick | mobile | A joystick implementation tool. It works on mobile devices. |
|
|
145
145
|
| Gameboy | mobile | A Gameboy implementation tool. It works on mobile devices. |
|
|
146
146
|
|
|
147
147
|
## Airplane
|
|
@@ -159,7 +159,7 @@ the airplane control in Gaesup World. Characters can board the airplane.
|
|
|
159
159
|
| Name | Condition | Info |
|
|
160
160
|
| -------- | --------- | ----------------------------------------------------------------------- |
|
|
161
161
|
| Keyboard | desktop | A standard keyboard tool. You can see where on the keyboard is clicked. |
|
|
162
|
-
|
|
|
162
|
+
| joystick | mobile | A joystick implementation tool. It works on mobile devices. |
|
|
163
163
|
| Gameboy | mobile | A Gameboy implementation tool. It works on mobile devices. |
|
|
164
164
|
|
|
165
165
|
# Animation
|
|
@@ -410,36 +410,36 @@ const App = () => {
|
|
|
410
410
|
2. Customize the appearance using the `gamePadStyle` and `gamePadButtonStyle` properties.
|
|
411
411
|
3. The component dynamically renders buttons based on the `control` mode.
|
|
412
412
|
|
|
413
|
-
##
|
|
413
|
+
## joystick
|
|
414
414
|
|
|
415
415
|
---
|
|
416
416
|
|
|
417
|
-
- The
|
|
417
|
+
- The joystick component provides a virtual joystick interface, primarily intended for mobile environments. This component allows you to simulate joystick-like input on mobile devices. Additionally, you can prevent position jitter, which can occur on mobile devices, by using the `scrollBlock` option in the `GaesupWorld` component.
|
|
418
418
|
|
|
419
419
|
### (1) props
|
|
420
420
|
|
|
421
421
|
| Prop Name | Type | Required | Description | Default Value |
|
|
422
422
|
| ------------------- | --------------- | -------- | --------------------------- | ------------- |
|
|
423
|
-
| `
|
|
424
|
-
| `
|
|
423
|
+
| `joystickStyle` | object (styles) | Optional | Style for the joystick | `undefined` |
|
|
424
|
+
| `joystickBallStyle` | object (styles) | Optional | Style for the joystick ball | `undefined` |
|
|
425
425
|
|
|
426
426
|
### (2) example
|
|
427
427
|
|
|
428
428
|
```jsx
|
|
429
429
|
const MyComponent = () => {
|
|
430
|
-
const
|
|
431
|
-
/*
|
|
430
|
+
const joystickStyle = {
|
|
431
|
+
/* joystickStyle */
|
|
432
432
|
};
|
|
433
|
-
const
|
|
434
|
-
/*
|
|
433
|
+
const joystickBallStyle = {
|
|
434
|
+
/* joystickBallStyle */
|
|
435
435
|
};
|
|
436
436
|
|
|
437
437
|
return (
|
|
438
438
|
<GaesupWorld>
|
|
439
439
|
{/* ... */}
|
|
440
|
-
<
|
|
441
|
-
|
|
442
|
-
|
|
440
|
+
<joystick
|
|
441
|
+
joystickStyle={joystickStyle}
|
|
442
|
+
joystickBallStyle={joystickBallStyle}
|
|
443
443
|
/>
|
|
444
444
|
{/* ... */}
|
|
445
445
|
</GaesupWorld>
|
|
@@ -449,8 +449,8 @@ const MyComponent = () => {
|
|
|
449
449
|
|
|
450
450
|
### (3) Key Features:
|
|
451
451
|
|
|
452
|
-
- **
|
|
453
|
-
- **Customization:** You can customize the style of the
|
|
452
|
+
- **joystick Interface:** Provides a joystick-like user input interface, suitable for mobile devices.
|
|
453
|
+
- **Customization:** You can customize the style of the joystick component by adjusting the styles of the joystick and the joystick ball using the `joystickBallStyle` and `joystickStyle` properties.
|
|
454
454
|
- **Responsive and Interactive:** It supports various input devices and responds to both mouse and mobile touch events for controlling movement.
|
|
455
455
|
|
|
456
456
|
## 4) JumpPortal
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import { vec3 } from "@react-three/rapier";
|
|
14
14
|
import { useContext, useEffect, useRef } from "react";
|
|
15
15
|
import * as THREE from "three";
|
|
16
|
-
import useClicker from "../hooks/useClicker";
|
|
16
|
+
import { useClicker } from "../hooks/useClicker";
|
|
17
17
|
import { GaesupWorldContext, GaesupWorldDispatchContext, } from "../world/context";
|
|
18
18
|
export function GaeSupProps(_a) {
|
|
19
19
|
var _b = _a.type, type = _b === void 0 ? "normal" : _b, text = _a.text, position = _a.position, children = _a.children;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContext, useEffect } from "react";
|
|
2
2
|
import { V3 } from "../../utils";
|
|
3
3
|
import { GaesupWorldContext, GaesupWorldDispatchContext, } from "../../world/context";
|
|
4
|
-
export
|
|
4
|
+
export function useClicker() {
|
|
5
5
|
var _a = useContext(GaesupWorldContext), activeState = _a.activeState, clicker = _a.clicker, mode = _a.mode;
|
|
6
6
|
var dispatch = useContext(GaesupWorldDispatchContext);
|
|
7
7
|
var moveClicker = function (e, isRun, type) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { joyStickBallType, joyStickOriginType } from "../../tools/
|
|
1
|
+
import { joyStickBallType, joyStickOriginType } from "../../tools/joystick/type";
|
|
2
2
|
export declare const joyStickBallDefault: {
|
|
3
3
|
top: string;
|
|
4
4
|
left: string;
|
|
@@ -31,7 +31,7 @@ export declare const joyStickInnerDefault: {
|
|
|
31
31
|
isCenter: boolean;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export declare function useJoyStick(): {
|
|
35
35
|
joyStickOrigin: joyStickOriginType;
|
|
36
36
|
joyStickBall: joyStickBallType;
|
|
37
37
|
setBall: (ball: joyStickBallType) => void;
|
|
@@ -30,7 +30,7 @@ export var joyStickInnerDefault = {
|
|
|
30
30
|
joyStickBall: joyStickBallDefault,
|
|
31
31
|
joyStickOrigin: joyStickOriginDefault,
|
|
32
32
|
};
|
|
33
|
-
export
|
|
33
|
+
export function useJoyStick() {
|
|
34
34
|
var joystick = useContext(GaesupWorldContext).joystick;
|
|
35
35
|
var dispatch = useContext(GaesupWorldDispatchContext);
|
|
36
36
|
var joyStickBall = joystick.joyStickBall, joyStickOrigin = joystick.joyStickOrigin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { joyStickInnerType } from "../../tools/
|
|
1
|
+
import { joyStickInnerType } from "../../tools/joystick/type";
|
|
2
2
|
import { activeStateType, clickerType, modeType } from "../../world/context/type";
|
|
3
3
|
import { calcType } from "../type";
|
|
4
4
|
export declare function orbitDirection({ activeState, control, mode, joystick, clicker, }: {
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useContext, useEffect, useRef, useState, } from "react";
|
|
14
|
-
import useJoyStick from "../../hooks/useJoyStick";
|
|
14
|
+
import { useJoyStick } from "../../hooks/useJoyStick";
|
|
15
15
|
import { GaesupWorldContext } from "../../world/context";
|
|
16
16
|
import "./style.css";
|
|
17
17
|
export function JoyStick(props) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
.joystick {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
/* .
|
|
14
|
+
/* .joystick::after {
|
|
15
15
|
content: "";
|
|
16
16
|
width: 10rem;
|
|
17
17
|
height: 10rem;
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
cursor: pointer;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
.
|
|
32
|
+
.joystick * {
|
|
33
33
|
-webkit-touch-callout: none;
|
|
34
34
|
-webkit-user-select: none;
|
|
35
35
|
-moz-user-select: none;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
1
2
|
export type joyStickBallType = {
|
|
2
3
|
left: string;
|
|
3
4
|
top: string;
|
|
@@ -17,3 +18,6 @@ export type joyStickInnerType = {
|
|
|
17
18
|
joyStickBall?: joyStickBallType;
|
|
18
19
|
joyStickOrigin?: joyStickOriginType;
|
|
19
20
|
};
|
|
21
|
+
export type joyStickType = {
|
|
22
|
+
[key in "joyStickBallStyle" | "joyStickStyle"]?: CSSProperties;
|
|
23
|
+
};
|
|
@@ -9,7 +9,7 @@ export declare function gaesupWorldReducer(props: Partial<gaesupWorldContextType
|
|
|
9
9
|
states?: import("./type").statesType;
|
|
10
10
|
debug?: boolean;
|
|
11
11
|
minimap?: import("../../tools/miniMap/type").minimapInnerType;
|
|
12
|
-
joystick?: import("../../tools/
|
|
12
|
+
joystick?: import("../../tools/joystick/type").joyStickInnerType;
|
|
13
13
|
control?: {
|
|
14
14
|
[x: string]: boolean;
|
|
15
15
|
};
|
|
@@ -2,7 +2,7 @@ import { CSSProperties } from "react";
|
|
|
2
2
|
import { actionsType, refsType } from "../../controller/type";
|
|
3
3
|
import * as THREE from "three";
|
|
4
4
|
import { rideableType } from "../../hooks/useRideable";
|
|
5
|
-
import { joyStickInnerType } from "../../tools/
|
|
5
|
+
import { joyStickInnerType } from "../../tools/joystick/type";
|
|
6
6
|
import { keyboardMapType } from "../../tools/keyBoardToolTip/type";
|
|
7
7
|
import { minimapInnerType } from "../../tools/miniMap/type";
|
|
8
8
|
import { dispatchType } from "../../utils/type";
|
|
@@ -9,7 +9,7 @@ export default function initGaesupWorld(props: gaesupWorldPropsType): {
|
|
|
9
9
|
states?: import("../context/type").statesType;
|
|
10
10
|
debug?: boolean;
|
|
11
11
|
minimap?: import("../../tools/miniMap/type").minimapInnerType;
|
|
12
|
-
joystick?: import("../../tools/
|
|
12
|
+
joystick?: import("../../tools/joystick/type").joyStickInnerType;
|
|
13
13
|
control?: {
|
|
14
14
|
[x: string]: boolean;
|
|
15
15
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * as Camera from "./gaesup/camera";
|
|
2
1
|
export { GaesupComponent } from "./gaesup/component";
|
|
3
2
|
export { PassiveAirplane } from "./gaesup/component/passive/airplane";
|
|
4
3
|
export { PassiveCharacter } from "./gaesup/component/passive/character";
|
|
@@ -6,9 +5,9 @@ export { PassiveVehicle } from "./gaesup/component/passive/vehicle";
|
|
|
6
5
|
export { GaesupController } from "./gaesup/controller";
|
|
7
6
|
export { GaeSupProps } from "./gaesup/gaesupProps";
|
|
8
7
|
export { Clicker } from "./gaesup/tools/clicker";
|
|
9
|
-
export { GameBoy } from "./gaesup/tools/
|
|
10
|
-
export { GamePad } from "./gaesup/tools/
|
|
11
|
-
export { JoyStick } from "./gaesup/tools/
|
|
8
|
+
export { GameBoy } from "./gaesup/tools/gameboy";
|
|
9
|
+
export { GamePad } from "./gaesup/tools/gamepad";
|
|
10
|
+
export { JoyStick } from "./gaesup/tools/joystick";
|
|
12
11
|
export { JumpPortal } from "./gaesup/tools/jumpPortal";
|
|
13
12
|
export { KeyBoardToolTip } from "./gaesup/tools/keyBoardToolTip";
|
|
14
13
|
export { MiniMap } from "./gaesup/tools/miniMap";
|
|
@@ -17,10 +16,10 @@ export { ZoomButton } from "./gaesup/tools/zoomButton";
|
|
|
17
16
|
export { InnerHtml } from "./gaesup/utils/innerHtml";
|
|
18
17
|
export { Elr, Qt, V3, V30, V31 } from "./gaesup/utils/vector";
|
|
19
18
|
export { GaesupWorld } from "./gaesup/world";
|
|
20
|
-
export
|
|
19
|
+
export { useClicker } from "./gaesup/hooks/useClicker";
|
|
21
20
|
export { useGaesupAnimation } from "./gaesup/hooks/useGaesupAnimation";
|
|
22
21
|
export { useGaesupController } from "./gaesup/hooks/useGaesupController";
|
|
23
|
-
export
|
|
22
|
+
export { useJoyStick } from "./gaesup/hooks/useJoyStick";
|
|
24
23
|
export { useMovePoint } from "./gaesup/hooks/useMovePoint";
|
|
25
24
|
export { usePushKey } from "./gaesup/hooks/usePushKey";
|
|
26
25
|
export { useRideable } from "./gaesup/hooks/useRideable";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * as Camera from "./gaesup/camera";
|
|
2
1
|
export { GaesupComponent } from "./gaesup/component";
|
|
3
2
|
export { PassiveAirplane } from "./gaesup/component/passive/airplane";
|
|
4
3
|
export { PassiveCharacter } from "./gaesup/component/passive/character";
|
|
@@ -6,9 +5,9 @@ export { PassiveVehicle } from "./gaesup/component/passive/vehicle";
|
|
|
6
5
|
export { GaesupController } from "./gaesup/controller";
|
|
7
6
|
export { GaeSupProps } from "./gaesup/gaesupProps";
|
|
8
7
|
export { Clicker } from "./gaesup/tools/clicker";
|
|
9
|
-
export { GameBoy } from "./gaesup/tools/
|
|
10
|
-
export { GamePad } from "./gaesup/tools/
|
|
11
|
-
export { JoyStick } from "./gaesup/tools/
|
|
8
|
+
export { GameBoy } from "./gaesup/tools/gameboy";
|
|
9
|
+
export { GamePad } from "./gaesup/tools/gamepad";
|
|
10
|
+
export { JoyStick } from "./gaesup/tools/joystick";
|
|
12
11
|
export { JumpPortal } from "./gaesup/tools/jumpPortal";
|
|
13
12
|
export { KeyBoardToolTip } from "./gaesup/tools/keyBoardToolTip";
|
|
14
13
|
export { MiniMap } from "./gaesup/tools/miniMap";
|
|
@@ -17,10 +16,10 @@ export { ZoomButton } from "./gaesup/tools/zoomButton";
|
|
|
17
16
|
export { InnerHtml } from "./gaesup/utils/innerHtml";
|
|
18
17
|
export { Elr, Qt, V3, V30, V31 } from "./gaesup/utils/vector";
|
|
19
18
|
export { GaesupWorld } from "./gaesup/world";
|
|
20
|
-
export
|
|
19
|
+
export { useClicker } from "./gaesup/hooks/useClicker";
|
|
21
20
|
export { useGaesupAnimation } from "./gaesup/hooks/useGaesupAnimation";
|
|
22
21
|
export { useGaesupController } from "./gaesup/hooks/useGaesupController";
|
|
23
|
-
export
|
|
22
|
+
export { useJoyStick } from "./gaesup/hooks/useJoyStick";
|
|
24
23
|
export { useMovePoint } from "./gaesup/hooks/useMovePoint";
|
|
25
24
|
export { usePushKey } from "./gaesup/hooks/usePushKey";
|
|
26
25
|
export { useRideable } from "./gaesup/hooks/useRideable";
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|