UNPKG

lingo3d

Version:

Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor

20 lines 1.2 kB
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime"; import IconButton from "../component/IconButton"; import PlayIcon from "../component/icons/PlayIcon"; import PauseIcon from "../component/icons/PauseIcon"; import useSyncState from "../hooks/useSyncState"; import { getWorldPlay, setWorldPlay } from "../../states/useWorldPlay"; import { setEditorRuntime } from "../../states/useEditorRuntime"; import { USE_RUNTIME } from "../../globals"; const WorldControls = () => { const play = useSyncState(getWorldPlay); return (_jsx("div", { style: { display: "flex", gap: 10 }, children: _jsxs("div", { style: { display: "flex" }, children: [_jsx(IconButton, { fill: true, disabled: play, onClick: () => { setWorldPlay(true); setEditorRuntime(USE_RUNTIME && true); }, children: _jsx(PlayIcon, {}) }), _jsx(IconButton, { fill: true, disabled: !play, onClick: () => { setWorldPlay(false); setEditorRuntime(USE_RUNTIME && false); }, children: _jsx(PauseIcon, {}) })] }) })); }; export default WorldControls; //# sourceMappingURL=WorldControls.js.map