| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This page explains all the commands and uses for the config.yml in the root directory of EntityJS games.
The config file lets you configure the interactions between the EntityJS gem and your game. This includes stuff like, script ordering, ignoring scripts, build settings and more. Currently the config file makes no changes to javascript code.
YML is a simple text structure often used for configuration of applications. Its just like JSON but very simple, here is an example both in JSON and YML.
canvas-id: game-canvas width: 500 height: 300 order: base.js tile.js entity-ignore: util/* scripts-ignore: gun.js items/*`
Is the same as this in JSON:
{
"canvas-id":"game-canvas",
"width":500,
"height":300,
"order":"base.js tile.js",
"entity-ignore":"util/*"
}
canvas-id Defines the canvas id and in the variable re.canvas.
height Defines the canvas height.
width Defines the canvas width.
scripts-ignore Will ignore scripts with similar names. Regex accepted.
entity-ignore Will ignore entityjs scripts with similar names. Regex accepted.
order Orders files to be included before other scripts. Entityjs scripts are always included first. Regex accepted.
Example: Ignore all scripts in the plugins folder build-scripts-ignore: plugins/*
Example: Ignore all Entityjs scripts build-entity-ignore: .*
build-head Appends whatever entered to the beginning of the game.min.js
build-foot Same thing as build-head except to the end.
Example: Wrap game inside a self-executing anonymous function on build
build-head: (function(){
build-foot: })();
In the future all settings in the config.yml file will be available in JS and HTML precompiling. Similar to #define in C++.
For example defining base-attack: 1.1 will replace all text of RE_BASE_ATTACK with "1.1" inside HTML and JS files.
Currently only RE_CANVAS_ID, RE_HEIGHT, RE_WIDTH and RE_VERSION are available in some cases.
| Back | FazBrowse Home | New Git URL |