Add Configuration
parent
f62daa5f58
commit
85677fd03f
|
@ -0,0 +1,62 @@
|
||||||
|
A short Summary of all the most importat configurations to use `empty.js`.
|
||||||
|
|
||||||
|
# FPS
|
||||||
|
```js
|
||||||
|
FPS = 30;
|
||||||
|
```
|
||||||
|
|
||||||
|
how often the `tick()` function is called per second.
|
||||||
|
|
||||||
|
# Canvas Size
|
||||||
|
```js
|
||||||
|
WIDTH = -1;
|
||||||
|
HEIGHT = -1;
|
||||||
|
```
|
||||||
|
|
||||||
|
the size, in pixels, of the canvas. `-1` will result in the maximum possible size, which depends on the browser window size.
|
||||||
|
|
||||||
|
Total canvas size includes the border. (`BORDER = 5; WIDTH = 50;` will result in a canvas of the size `40x40` with a `5px` border on each side)
|
||||||
|
|
||||||
|
# Canvas Positioning
|
||||||
|
```
|
||||||
|
LEFT = 0.5;
|
||||||
|
TOP = 0.5;
|
||||||
|
```
|
||||||
|
|
||||||
|
the distance from the middle point of the canvas to the left and top edge of the browser window, defined as a fraction between 0 and 1. These default values will result in a centered canvas.
|
||||||
|
|
||||||
|
# Border
|
||||||
|
```js
|
||||||
|
BORDER = 0;
|
||||||
|
BORDER_COLOR = "black";
|
||||||
|
```
|
||||||
|
|
||||||
|
`BORDER` is the border width, in pixels, of the canvas. A value of `0` will completely disable the border. `BORDER_COLOR` is a CSS Color Code to define the border's color.
|
||||||
|
|
||||||
|
# Fullscreen
|
||||||
|
```js
|
||||||
|
FULLSCREEN = false;
|
||||||
|
```
|
||||||
|
|
||||||
|
Whether or not to request fullscreen if possible.
|
||||||
|
|
||||||
|
# Page Title
|
||||||
|
```
|
||||||
|
PAGE_TITLE = "Empty.js";
|
||||||
|
```
|
||||||
|
|
||||||
|
Title of the window (like `<title>Empty.js</title>`).
|
||||||
|
|
||||||
|
# Pause
|
||||||
|
```
|
||||||
|
PAUSED = false;
|
||||||
|
```
|
||||||
|
|
||||||
|
Set to `true` to pause execution of any renders and calling of the `tick()` function.
|
||||||
|
|
||||||
|
# Cursor
|
||||||
|
```
|
||||||
|
CURSOR = "default";
|
||||||
|
```
|
||||||
|
|
||||||
|
Set the Cursor shown when hovering the canvas. Use normal CSS Cursors like `pointer` or `crosshair`. Use `none` to hide cursor completely (for example to display a custom cursor on the canvas).
|
Reference in New Issue