// Converts a coordinate on the map to the corresponding coordinate on the screen.
rx: function(x, scrollRate) {
if (scrollRate == null) {
scrollRate = $gameMap.tileWidth();
}
assignSettings: function(settings) {
var code = '';
for (var key in settings) {
var value = settings[key];
if (typeof(value) === 'string') {
// this.x = (formula);
// this.scale.x = (formula); // key is "scale.x"
code += 'this.' + key + ' = (' + value + ');\n';
} else {
// if key is "scale.x"
// keys is ["scale", "x"]
var keys = key.split('.');
// set key to "x"
key = keys.pop();
var target = this;
keys.forEach(function(k) {
if (typeof(target) !== 'object') {
target[k] = {};
}
target = target[k];
});
target[key] = value;
}
}
// You may log the code for debugging purpose.
// console.log(code);
this._updater = new Function('t', 's', 'v', code);
}
};
var parameters = PluginManager.parameters("auto_light");
var path = parameters["path"] || "auto_light";
var opacity = parseInt(parameters["opacity"], 10) || 150;
var lamp_config_parameter;
if (typeof parameters["config"] == "undefined" || parameters["config"] == null) {
lamp_config_parameter = [
[1, 10, 2],
[2, 5, 1],
[3, 20, 3]
];
} else {
lamp_config_parameter = JSON.parse(parameters["config"]);
}
var note_regexp = /<autolight>([^]*?)<\/autolight>/ig;
var lamp_config = [];
for (var i in lamp_config_parameter) {
var v = lamp_config_parameter;
lamp_config[v[0]] = {
halo_x: v[1],
halo_k: v[2]
};
}
console.log(lamp_config);
var fs = require('fs');
var ph = require('path');
var childProcess = require('child_process');
var base = ph.dirname(process.mainModule.filename);
var complete_path = `${base}/img/${path}`;
var light_cmd = `${base}/light.exe`;
/*
lamp_config[1] = {
halo_x: 10,
halo_k: 2
}
*/
// NOT a class constructor
function ULDS(settings) {
settings = Object.assign({}, DEFAULT_SETTINGS, settings);
var spriteClass = ULDS.Sprite;
var bitmap;