gaesup-world 0.6.79 → 0.6.81

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.
@@ -19,7 +19,7 @@ import "./style.css";
19
19
  export function MiniMap(props) {
20
20
  var _a = useContext(GaesupWorldContext), minimap = _a.minimap, activeState = _a.activeState, mode = _a.mode;
21
21
  var _b = useState(props.scale || minimapDefault.scale), scale = _b[0], setscale = _b[1];
22
- var innerStyle = props.innerStyle, textStyle = props.textStyle, objectStyle = props.objectStyle, avatarStyle = props.avatarStyle, scaleStyle = props.scaleStyle, directionStyle = props.directionStyle, plusMinusStyle = props.plusMinusStyle;
22
+ var innerStyle = props.innerStyle, textStyle = props.textStyle, objectStyle = props.objectStyle, avatarStyle = props.avatarStyle, scaleStyle = props.scaleStyle, directionStyle = props.directionStyle, plusMinusStyle = props.plusMinusStyle, imageStyle = props.imageStyle;
23
23
  var upscale = useCallback(function () {
24
24
  var max = props.maxScale || minimapDefault.maxScale;
25
25
  setscale(function (scale) { return Math.min(max, scale + 0.1); });
@@ -37,7 +37,7 @@ export function MiniMap(props) {
37
37
  downscale();
38
38
  }, children: [_jsx("div", { className: "minimapOuter", style: objectStyle }), _jsxs("div", { className: "minimapInner", style: __assign({ transform: props.blockRotate || mode.control === "normal"
39
39
  ? "translate(-50%, -50%) rotate(180deg) "
40
- : "translate(-50%, -50%) rotate(".concat((activeState.euler.y * 180) / Math.PI + 180, "deg) ") }, innerStyle), children: [_jsx("div", { className: "east direction", style: __assign({ transform: props.blockRotate || mode.control === "normal"
40
+ : "translate(-50%, -50%) rotate(".concat((activeState.euler.y * 180) / Math.PI + 180, "deg) ") }, innerStyle), children: [" ", _jsx("div", { className: "east direction", style: __assign({ transform: props.blockRotate || mode.control === "normal"
41
41
  ? "translate(-50%, -50%) rotate(180deg) "
42
42
  : "translate(-50%, -50%) rotate(-".concat((activeState.euler.y * 180) / Math.PI + 180, "deg) ") }, directionStyle), children: "E" }), _jsx("div", { className: "west direction", style: __assign({ transform: props.blockRotate || mode.control === "normal"
43
43
  ? "translate(50%, -50%) rotate(180deg) "
@@ -45,7 +45,7 @@ export function MiniMap(props) {
45
45
  ? "translate(-50%, 50%) rotate(180deg) "
46
46
  : "translate(-50%, 50%) rotate(-".concat((activeState.euler.y * 180) / Math.PI + 180, "deg) ") }, directionStyle), children: "S" }), _jsx("div", { className: "north direction", style: __assign({ transform: props.blockRotate || mode.control === "normal"
47
47
  ? "translate(-50%, -50%) rotate(180deg) "
48
- : "translate(-50%, -50%) rotate(-".concat((activeState.euler.y * 180) / Math.PI + 180, "deg) ") }, directionStyle), children: "N" }), Object.values(minimap.props).map(function (_a, key) {
48
+ : "translate(-50%, -50%) rotate(-".concat((activeState.euler.y * 180) / Math.PI + 180, "deg) ") }, directionStyle), children: "N" }), props.isImage && (_jsx("img", { src: props.imageUrl, className: "minimapObject", style: __assign({ width: "".concat(100 * scale, "rem"), height: "".concat(100 * scale, "rem"), top: "50%", left: "50%", transform: "translate(-50.1%, -50.1%) translate(".concat(activeState.position.x * scale, "rem, ").concat(activeState.position.z, "rem)"), transformOrigin: "50% 50%", zIndex: 100 }, imageStyle) })), Object.values(minimap.props).map(function (_a, key) {
49
49
  var center = _a.center, size = _a.size, text = _a.text;
50
50
  var X = (center.x - activeState.position.x) * scale;
51
51
  var Z = (center.z - activeState.position.z) * scale;
@@ -14,7 +14,7 @@ export type minimapInnerType = {
14
14
  };
15
15
  };
16
16
  export type minimapType = {
17
- [key in "minimapStyle" | "outerStyle" | "innerStyle" | "textStyle" | "objectStyle" | "avatarStyle" | "directionStyle" | "scaleStyle" | "plusMinusStyle"]?: CSSProperties;
17
+ [key in "minimapStyle" | "outerStyle" | "innerStyle" | "textStyle" | "objectStyle" | "avatarStyle" | "directionStyle" | "scaleStyle" | "imageStyle" | "plusMinusStyle"]?: CSSProperties;
18
18
  } & {
19
19
  minScale?: number;
20
20
  maxScale?: number;
@@ -22,4 +22,8 @@ export type minimapType = {
22
22
  scale?: number;
23
23
  blockRotate?: boolean;
24
24
  blockScaleControl?: boolean;
25
+ isImage?: boolean;
26
+ imageUrl?: string;
27
+ imageWidth?: number;
28
+ imageHeight?: number;
25
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.6.79",
3
+ "version": "0.6.81",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",