mylingo3d
Version:
Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor
21 lines • 2.05 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
import register from "preact-custom-element";
import HotKey from "./HotKey";
import { useCameraRendered, useEditorMounted } from "../states";
import mainCamera from "../../engine/mainCamera";
import { createPortal } from "preact/compat";
import { container } from "../../engine/renderLoop/renderSetup";
const HUD = () => {
const [editorMounted] = useEditorMounted();
const [cameraRendered] = useCameraRendered();
return createPortal(_jsx("div", { className: "lingo3d-ui", style: {
position: "absolute",
width: "100%",
height: "100%",
pointerEvents: "none",
padding: 10
}, children: !!editorMounted && cameraRendered === mainCamera && (_jsxs("div", { style: { opacity: 0.5 }, children: [_jsx(HotKey, { hotkey: "\u21E7", description: "accelerate" }), _jsx(HotKey, { hotkey: "W", description: "move forward" }), _jsx(HotKey, { hotkey: "S", description: "move backwards" }), _jsx(HotKey, { hotkey: "A", description: "move left" }), _jsx(HotKey, { hotkey: "D", description: "move right" }), _jsx(HotKey, { hotkey: "\u2191", description: "move up" }), _jsx(HotKey, { hotkey: "\u2193", description: "move down" }), _jsx(HotKey, { hotkey: "C", description: "center selected" }), _jsx(HotKey, { hotkey: "\u232B", description: "delete selected" }), _jsxs("div", { style: { display: "flex", gap: 4 }, children: [_jsx(HotKey, { hotkey: "\u2318" }), _jsx(HotKey, { hotkey: "C", description: "copy selected" })] }), _jsxs("div", { style: { display: "flex", gap: 4 }, children: [_jsx(HotKey, { hotkey: "\u2318" }), _jsx(HotKey, { hotkey: "O", description: "open folder" })] }), _jsxs("div", { style: { display: "flex", gap: 4 }, children: [_jsx(HotKey, { hotkey: "\u2318" }), _jsx(HotKey, { hotkey: "S", description: "save scene" })] }), _jsx(HotKey, { hotkey: "G", description: "toggle grid" })] })) }), container);
};
export default HUD;
register(HUD, "lingo3d-hud");
//# sourceMappingURL=index.js.map