summaryrefslogtreecommitdiffstats
path: root/src/renderer
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2020-03-17 18:43:22 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2020-03-17 18:43:22 +0100
commit6c8f2d780acd6c41d42de6b5fc8d84e765334b64 (patch)
tree5f157118407a571d6a2bf6d2563d2317b44fb186 /src/renderer
parent7dce448d9bd20fd72849dab94cef3bae253c7867 (diff)
downloadrpgedit-6c8f2d780acd6c41d42de6b5fc8d84e765334b64.tar
rpgedit-6c8f2d780acd6c41d42de6b5fc8d84e765334b64.zip
Prepare for editor implementation
- Add React and Material UI - Add React Developer Tools - Add ESlint plugin and config
Diffstat (limited to 'src/renderer')
-rw-r--r--src/renderer/editor/editor.tsx10
-rw-r--r--src/renderer/index.html1
-rw-r--r--src/renderer/index.ts27
-rw-r--r--src/renderer/index.tsx8
4 files changed, 19 insertions, 27 deletions
diff --git a/src/renderer/editor/editor.tsx b/src/renderer/editor/editor.tsx
new file mode 100644
index 0000000..fd8360a
--- /dev/null
+++ b/src/renderer/editor/editor.tsx
@@ -0,0 +1,10 @@
+import * as React from 'react';
+import Button from '@material-ui/core/Button';
+
+export function Editor(): JSX.Element {
+ return (
+ <Button variant='contained' color='primary'>
+ Hello World
+ </Button>
+ );
+}
diff --git a/src/renderer/index.html b/src/renderer/index.html
index 5bd9d1f..e775d3e 100644
--- a/src/renderer/index.html
+++ b/src/renderer/index.html
@@ -3,6 +3,7 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
+ <meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width" />
<title>RPGedit</title>
</head>
<body>
diff --git a/src/renderer/index.ts b/src/renderer/index.ts
deleted file mode 100644
index 490dbef..0000000
--- a/src/renderer/index.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import './runtime/index.css';
-
-import { GameContext } from './runtime/controller/gamecontext';
-
-import { Renderer } from './runtime/view/renderer/renderer';
-
-window.onload = async (): Promise<void> => {
- const app = document.getElementById('app');
- if (!app) return;
-
- const canvas = document.createElement('canvas');
- const renderer = new Renderer(canvas);
-
- const resize = (): void => {
- canvas.width = window.innerWidth;
- canvas.height = window.innerHeight;
- renderer.resize();
- };
- window.addEventListener('resize', resize);
- resize();
-
- app.append(canvas);
-
- GameContext.load(renderer);
-};
-
-module.hot?.accept();
diff --git a/src/renderer/index.tsx b/src/renderer/index.tsx
new file mode 100644
index 0000000..2920265
--- /dev/null
+++ b/src/renderer/index.tsx
@@ -0,0 +1,8 @@
+import * as React from 'react';
+import * as ReactDOM from 'react-dom';
+
+import { Editor } from './editor/editor';
+
+ReactDOM.render(<Editor />, document.querySelector('#app'));
+
+module.hot?.accept();