-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
26 lines (22 loc) · 855 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
window.$ = window.jQuery = require('jquery');
const fs = require('fs');
const stats = require("stats.js");
const uuid = require('uuid');
const PIXI = window.PIXI = require("pixi.js");
require("pixi-tilemap");
$(document).on('dragstart', '*', function (event) {
event.preventDefault();
});
const tilemapChromaFragmentShader = fs.readFileSync("assets/glsl/tilemap_chroma.frag").toString();
window.tilemapChromaFragmentShader = tilemapChromaFragmentShader;
PIXI.tilemap.shaderGenerator.generateFragmentSrc = (maxTextures) => {
return tilemapChromaFragmentShader.replace(/%count%/gi, maxTextures + "")
.replace(/%forloop%/gi, PIXI.tilemap.shaderGenerator.generateSampleSrc(maxTextures));
};
// Project JS files.
const main = require("./assets/js/main.js");
// Start application.
$(function () {
console.log('### START ###');
main.start();
});