0.0.15 • Published 1 year ago
enpyre v0.0.15
Enpyre is an open-source library to render 2D games made with Python in React with graphics by PIXI.js and the power of Pyodide, WASM, and modern web technologies.
Install
npm install enpyre
yarn add enpyre
Optional Dependencies
If you want to use EnpyreEditor
you will need to install the following dependencies:
npm install react-ace ace-builds
yarn add react-ace ace-builds
Usage
import React from 'react';
import {
EnpyreDisplay,
EnpyreEditor,
EnpyreProvider,
usePyodide,
} from 'enpyre';
const Example: React.FC = () => {
const { runCode } = usePyodide();
return (
<div>
<EnpyreDisplay />
<EnpyreEditor />
<button onClick={runCode}>Run Code</button>
</div>
);
};
const App: React.FC = () => {
return (
<EnpyreProvider>
<Example />
</EnpyreProvider>
);
};
export default App;