|
27 | 27 | var assert = (condition, message = "Assertion failed") => {
|
28 | 28 | if (!condition) throw new Error(message);
|
29 | 29 | };
|
30 |
| - var version = "0.98.4"; |
| 30 | + var version = "0.99.0"; |
31 | 31 | function litecanvas(settings = {}) {
|
32 | 32 | const root = window, math = Math, TWO_PI = math.PI * 2, raf = requestAnimationFrame, _browserEventListeners = [], on = (elem, evt, callback) => {
|
33 | 33 | elem.addEventListener(evt, callback, false);
|
|
43 | 43 | keyboardEvents: true
|
44 | 44 | };
|
45 | 45 | settings = Object.assign(defaults, settings);
|
46 |
| - let _initialized = false, _canvas, _scale = 1, _ctx, _outline_fix = 0.5, _timeScale = 1, _lastFrameTime, _fpsInterval = 1e3 / 60, _accumulated, _rafid, _fontFamily = "sans-serif", _fontSize = 20, _rngSeed = Date.now(), _colorPalette = defaultPalette, _colorPaletteState = [], _defaultSound = [0.5, 0, 1750, , , 0.3, 1, , , , 600, 0.1], _coreEvents = "init,update,draw,tap,untap,tapping,tapped,resized", _mathFunctions = "PI,sin,cos,atan2,hypot,tan,abs,ceil,floor,trunc,min,max,pow,sqrt,sign,exp", _eventListeners = {}; |
| 46 | + let _initialized = false, _paused = true, _canvas, _scale = 1, _ctx, _outline_fix = 0.5, _timeScale = 1, _lastFrameTime, _fpsInterval = 1e3 / 60, _accumulated, _rafid, _fontFamily = "sans-serif", _fontSize = 20, _rngSeed = Date.now(), _colorPalette = defaultPalette, _colorPaletteState = [], _defaultSound = [0.5, 0, 1750, , , 0.3, 1, , , , 600, 0.1], _coreEvents = "init,update,draw,tap,untap,tapping,tapped,resized", _mathFunctions = "PI,sin,cos,atan2,hypot,tan,abs,ceil,floor,trunc,min,max,pow,sqrt,sign,exp", _eventListeners = {}; |
47 | 47 | const instance = {
|
48 | 48 | /** @type {number} */
|
49 | 49 | W: 0,
|
|
988 | 988 | _fpsInterval = 1e3 / ~~value;
|
989 | 989 | },
|
990 | 990 | /**
|
991 |
| - * Returns information about that engine instance. |
| 991 | + * Returns information about the engine instance. |
992 | 992 | *
|
993 | 993 | * @param {number|string} index
|
994 | 994 | * @returns {any}
|
|
1021 | 1021 | _rngSeed,
|
1022 | 1022 | // 10
|
1023 | 1023 | _fontSize,
|
1024 |
| - // 11 |
1025 |
| - _fontFamily |
| 1024 | + // 11 |
| 1025 | + _fontFamily, |
| 1026 | + // 12 |
| 1027 | + _colorPaletteState |
1026 | 1028 | ];
|
1027 | 1029 | const data = { index, value: internals[index] };
|
1028 | 1030 | instance.emit("stat", data);
|
1029 | 1031 | return data.value;
|
1030 | 1032 | },
|
1031 |
| - /** |
1032 |
| - * Stops the litecanvas instance and remove all event listeners. |
1033 |
| - */ |
1034 |
| - quit() { |
1035 |
| - instance.pause(); |
1036 |
| - instance.emit("quit"); |
1037 |
| - _eventListeners = {}; |
1038 |
| - for (const removeListener of _browserEventListeners) { |
1039 |
| - removeListener(); |
1040 |
| - } |
1041 |
| - if (settings.global) { |
1042 |
| - for (const key in instance) { |
1043 |
| - delete root[key]; |
1044 |
| - } |
1045 |
| - delete root.ENGINE; |
1046 |
| - } |
1047 |
| - _initialized = false; |
1048 |
| - }, |
1049 | 1033 | /**
|
1050 | 1034 | * Pauses the engine loop (update & draw).
|
1051 | 1035 | */
|
1052 | 1036 | pause() {
|
| 1037 | + _paused = true; |
1053 | 1038 | cancelAnimationFrame(_rafid);
|
1054 |
| - _rafid = 0; |
1055 | 1039 | },
|
1056 | 1040 | /**
|
1057 | 1041 | * Resumes (if paused) the engine loop.
|
1058 | 1042 | */
|
1059 | 1043 | resume() {
|
1060 |
| - if (_initialized && !_rafid) { |
| 1044 | + DEV: assert( |
| 1045 | + _initialized, |
| 1046 | + '[litecanvas] resume() cannot be called before the "init" event and neither after the quit() function' |
| 1047 | + ); |
| 1048 | + if (_initialized && _paused) { |
| 1049 | + _paused = false; |
1061 | 1050 | _accumulated = _fpsInterval;
|
1062 | 1051 | _lastFrameTime = Date.now();
|
1063 | 1052 | _rafid = raf(drawFrame);
|
|
1069 | 1058 | * @returns {boolean}
|
1070 | 1059 | */
|
1071 | 1060 | paused() {
|
1072 |
| - return !_rafid; |
| 1061 | + return _paused; |
| 1062 | + }, |
| 1063 | + /** |
| 1064 | + * Shutdown the litecanvas instance and remove all event listeners. |
| 1065 | + */ |
| 1066 | + quit() { |
| 1067 | + instance.emit("quit"); |
| 1068 | + instance.pause(); |
| 1069 | + _initialized = false; |
| 1070 | + _eventListeners = {}; |
| 1071 | + for (const removeListener of _browserEventListeners) { |
| 1072 | + removeListener(); |
| 1073 | + } |
| 1074 | + if (settings.global) { |
| 1075 | + for (const key in instance) { |
| 1076 | + delete root[key]; |
| 1077 | + } |
| 1078 | + delete root.ENGINE; |
| 1079 | + } |
| 1080 | + DEV: console.warn("[litecanvas] quit() terminated a Litecanvas instance."); |
1073 | 1081 | }
|
1074 | 1082 | };
|
1075 | 1083 | for (const k of _mathFunctions.split(",")) {
|
|
1421 | 1429 | if ("loading" === document.readyState) {
|
1422 | 1430 | on(root, "DOMContentLoaded", () => raf(init));
|
1423 | 1431 | } else {
|
1424 |
| - raf(init); |
| 1432 | + _rafid = raf(init); |
1425 | 1433 | }
|
1426 | 1434 | return instance;
|
1427 | 1435 | }
|
|
2245 | 2253 | window.pluginFrameRateMeter = E;
|
2246 | 2254 | })();
|
2247 | 2255 | (() => {
|
2248 |
| - var C = [[24, 60, 60, 24, 24, , 24], [54, 54, , , , , ,], [54, 54, 127, 54, 127, 54, 54], [12, 62, 3, 30, 48, 31, 12], [, 99, 51, 24, 12, 102, 99], [28, 54, 28, 110, 59, 51, 110], [6, 6, 3, , , , ,], [24, 12, 6, 6, 6, 12, 24], [6, 12, 24, 24, 24, 12, 6], [, 102, 60, 255, 60, 102, ,], [, 12, 12, 63, 12, 12, ,], [, , , , , 12, 12, 6], [, , , 63, , , ,], [, , , , , 12, 12], [96, 48, 24, 12, 6, 3, 1], [62, 99, 115, 123, 111, 103, 62], [12, 14, 12, 12, 12, 12, 63], [30, 51, 48, 28, 6, 51, 63], [30, 51, 48, 28, 48, 51, 30], [56, 60, 54, 51, 127, 48, 120], [63, 3, 31, 48, 48, 51, 30], [28, 6, 3, 31, 51, 51, 30], [63, 51, 48, 24, 12, 12, 12], [30, 51, 51, 30, 51, 51, 30], [30, 51, 51, 62, 48, 24, 14], [, 12, 12, , , 12, 12], [, 12, 12, , , 12, 12, 6], [24, 12, 6, 3, 6, 12, 24], [, , 63, , , 63, ,], [6, 12, 24, 48, 24, 12, 6], [30, 51, 48, 24, 12, , 12], [62, 99, 123, 123, 123, 3, 30], [12, 30, 51, 51, 63, 51, 51], [63, 102, 102, 62, 102, 102, 63], [60, 102, 3, 3, 3, 102, 60], [31, 54, 102, 102, 102, 54, 31], [127, 70, 22, 30, 22, 70, 127], [127, 70, 22, 30, 22, 6, 15], [60, 102, 3, 3, 115, 102, 124], [51, 51, 51, 63, 51, 51, 51], [30, 12, 12, 12, 12, 12, 30], [120, 48, 48, 48, 51, 51, 30], [103, 102, 54, 30, 54, 102, 103], [15, 6, 6, 6, 70, 102, 127], [99, 119, 127, 127, 107, 99, 99], [99, 103, 111, 123, 115, 99, 99], [28, 54, 99, 99, 99, 54, 28], [63, 102, 102, 62, 6, 6, 15], [30, 51, 51, 51, 59, 30, 56], [63, 102, 102, 62, 54, 102, 103], [30, 51, 7, 14, 56, 51, 30], [63, 45, 12, 12, 12, 12, 30], [51, 51, 51, 51, 51, 51, 63], [51, 51, 51, 51, 51, 30, 12], [99, 99, 99, 107, 127, 119, 99], [99, 99, 54, 28, 28, 54, 99], [51, 51, 51, 30, 12, 12, 30], [127, 99, 49, 24, 76, 102, 127], [30, 6, 6, 6, 6, 6, 30], [3, 6, 12, 24, 48, 96, 64], [30, 24, 24, 24, 24, 24, 30], [8, 28, 54, 99, , , ,], [, , , , , , , 255], [12, 12, 24, , , , ,], [, , 30, 48, 62, 51, 110], [7, 6, 6, 62, 102, 102, 59], [, , 30, 51, 3, 51, 30], [56, 48, 48, 62, 51, 51, 110], [, , 30, 51, 63, 3, 30], [28, 54, 6, 15, 6, 6, 15], [, , 110, 51, 51, 62, 48, 31], [7, 6, 54, 110, 102, 102, 103], [12, , 14, 12, 12, 12, 30], [48, , 48, 48, 48, 51, 51, 30], [7, 6, 102, 54, 30, 54, 103], [14, 12, 12, 12, 12, 12, 30], [, , 51, 127, 127, 107, 99], [, , 31, 51, 51, 51, 51], [, , 30, 51, 51, 51, 30], [, , 59, 102, 102, 62, 6, 15], [, , 110, 51, 51, 62, 48, 120], [, , 59, 110, 102, 6, 15], [, , 62, 3, 30, 48, 31], [8, 12, 62, 12, 12, 44, 24], [, , 51, 51, 51, 51, 110], [, , 51, 51, 51, 30, 12], [, , 99, 107, 127, 127, 54], [, , 99, 54, 28, 54, 99], [, , 51, 51, 51, 62, 48, 31], [, , 63, 25, 12, 38, 63], [56, 12, 12, 7, 12, 12, 56], [24, 24, 24, , 24, 24, 24], [7, 12, 12, 56, 12, 12, 7], [110, 59, , , , , ,]], F = (e, s, p = 3) => { |
2249 |
| - for (let t = 0; t < 8; t++) for (let c = 0; c < 8; c++) (s[t] | 0) & 1 << c && e.rectfill(c, t, 1, 1, p); |
2250 |
| - }, h = { id: "basic", chars: C, first: 33, w: 8, h: 8, render: F }; |
2251 |
| - var S = [[34, 32, 32], [85, 0, 0], [87, 87, 80], [99, 103, 32], [84, 33, 80], [99, 101, 96], [34, 0, 0], [33, 17, 32], [36, 68, 32], [82, 80, 0], [2, 114, 0], [0, 0, 33], [0, 112, 0], [0, 0, 16], [68, 33, 16], [117, 85, 112], [50, 34, 112], [116, 113, 112], [116, 116, 112], [85, 116, 64], [113, 116, 112], [113, 117, 112], [116, 68, 64], [117, 117, 112], [117, 116, 112], [0, 32, 32], [0, 32, 33], [66, 18, 64], [7, 7, 0], [18, 66, 16], [116, 96, 32], [37, 81, 96], [37, 117, 80], [53, 53, 48], [97, 17, 96], [53, 85, 48], [113, 49, 112], [113, 49, 16], [97, 85, 96], [85, 117, 80], [114, 34, 112], [68, 69, 32], [85, 53, 80], [17, 17, 112], [87, 117, 80], [117, 85, 80], [37, 85, 32], [117, 113, 16], [101, 83, 96], [53, 53, 80], [97, 116, 48], [114, 34, 32], [85, 85, 112], [85, 82, 32], [85, 119, 80], [85, 37, 80], [85, 34, 32], [116, 33, 112], [98, 34, 96], [17, 36, 64], [50, 34, 48], [37, 0, 0], [0, 0, 112], [18, 0, 0], [6, 85, 96], [19, 85, 48], [6, 17, 96], [70, 85, 96], [2, 83, 96], [66, 114, 32], [2, 86, 66], [17, 53, 80], [2, 2, 32], [2, 2, 33], [21, 53, 80], [34, 34, 64], [5, 117, 80], [3, 85, 80], [2, 85, 32], [3, 85, 49], [6, 85, 100], [2, 81, 16], [6, 20, 48], [39, 34, 64], [5, 85, 96], [5, 82, 32], [5, 87, 80], [5, 34, 80], [5, 86, 66], [7, 65, 112], [98, 18, 96], [34, 34, 32], [50, 66, 48], [3, 96, 0]], P = (e, s, p = 3) => { |
| 2256 | + var C = [[24, 60, 60, 24, 24, , 24], [54, 54, , , , , ,], [54, 54, 127, 54, 127, 54, 54], [12, 62, 3, 30, 48, 31, 12], [, 99, 51, 24, 12, 102, 99], [28, 54, 28, 110, 59, 51, 110], [6, 6, 3, , , , ,], [24, 12, 6, 6, 6, 12, 24], [6, 12, 24, 24, 24, 12, 6], [, 102, 60, 255, 60, 102, ,], [, 12, 12, 63, 12, 12, ,], [, , , , , 12, 12, 6], [, , , 63, , , ,], [, , , , , 12, 12], [96, 48, 24, 12, 6, 3, 1], [62, 99, 115, 123, 111, 103, 62], [12, 14, 12, 12, 12, 12, 63], [30, 51, 48, 28, 6, 51, 63], [30, 51, 48, 28, 48, 51, 30], [56, 60, 54, 51, 127, 48, 120], [63, 3, 31, 48, 48, 51, 30], [28, 6, 3, 31, 51, 51, 30], [63, 51, 48, 24, 12, 12, 12], [30, 51, 51, 30, 51, 51, 30], [30, 51, 51, 62, 48, 24, 14], [, 12, 12, , , 12, 12], [, 12, 12, , , 12, 12, 6], [24, 12, 6, 3, 6, 12, 24], [, , 63, , , 63, ,], [6, 12, 24, 48, 24, 12, 6], [30, 51, 48, 24, 12, , 12], [62, 99, 123, 123, 123, 3, 30], [12, 30, 51, 51, 63, 51, 51], [63, 102, 102, 62, 102, 102, 63], [60, 102, 3, 3, 3, 102, 60], [31, 54, 102, 102, 102, 54, 31], [127, 70, 22, 30, 22, 70, 127], [127, 70, 22, 30, 22, 6, 15], [60, 102, 3, 3, 115, 102, 124], [51, 51, 51, 63, 51, 51, 51], [30, 12, 12, 12, 12, 12, 30], [120, 48, 48, 48, 51, 51, 30], [103, 102, 54, 30, 54, 102, 103], [15, 6, 6, 6, 70, 102, 127], [99, 119, 127, 127, 107, 99, 99], [99, 103, 111, 123, 115, 99, 99], [28, 54, 99, 99, 99, 54, 28], [63, 102, 102, 62, 6, 6, 15], [30, 51, 51, 51, 59, 30, 56], [63, 102, 102, 62, 54, 102, 103], [30, 51, 7, 14, 56, 51, 30], [63, 45, 12, 12, 12, 12, 30], [51, 51, 51, 51, 51, 51, 63], [51, 51, 51, 51, 51, 30, 12], [99, 99, 99, 107, 127, 119, 99], [99, 99, 54, 28, 28, 54, 99], [51, 51, 51, 30, 12, 12, 30], [127, 99, 49, 24, 76, 102, 127], [30, 6, 6, 6, 6, 6, 30], [3, 6, 12, 24, 48, 96, 64], [30, 24, 24, 24, 24, 24, 30], [8, 28, 54, 99, , , ,], [, , , , , , , 255], [12, 12, 24, , , , ,], [, , 30, 48, 62, 51, 110], [7, 6, 6, 62, 102, 102, 59], [, , 30, 51, 3, 51, 30], [56, 48, 48, 62, 51, 51, 110], [, , 30, 51, 63, 3, 30], [28, 54, 6, 15, 6, 6, 15], [, , 110, 51, 51, 62, 48, 31], [7, 6, 54, 110, 102, 102, 103], [12, , 14, 12, 12, 12, 30], [48, , 48, 48, 48, 51, 51, 30], [7, 6, 102, 54, 30, 54, 103], [14, 12, 12, 12, 12, 12, 30], [, , 51, 127, 127, 107, 99], [, , 31, 51, 51, 51, 51], [, , 30, 51, 51, 51, 30], [, , 59, 102, 102, 62, 6, 15], [, , 110, 51, 51, 62, 48, 120], [, , 59, 110, 102, 6, 15], [, , 62, 3, 30, 48, 31], [8, 12, 62, 12, 12, 44, 24], [, , 51, 51, 51, 51, 110], [, , 51, 51, 51, 30, 12], [, , 99, 107, 127, 127, 54], [, , 99, 54, 28, 54, 99], [, , 51, 51, 51, 62, 48, 31], [, , 63, 25, 12, 38, 63], [56, 12, 12, 7, 12, 12, 56], [24, 24, 24, , 24, 24, 24], [7, 12, 12, 56, 12, 12, 7], [110, 59, , , , , ,]], F = (e, s, m = 3) => { |
| 2257 | + for (let t = 0; t < 8; t++) for (let l = 0; l < 8; l++) (s[t] | 0) & 1 << l && e.rectfill(l, t, 1, 1, m); |
| 2258 | + }, v = { id: "basic", chars: C, first: 33, w: 8, h: 8, render: F }; |
| 2259 | + var S = [[34, 32, 32], [85, 0, 0], [87, 87, 80], [99, 103, 32], [84, 33, 80], [99, 101, 96], [34, 0, 0], [33, 17, 32], [36, 68, 32], [82, 80, 0], [2, 114, 0], [0, 0, 33], [0, 112, 0], [0, 0, 16], [68, 33, 16], [117, 85, 112], [50, 34, 112], [116, 113, 112], [116, 116, 112], [85, 116, 64], [113, 116, 112], [113, 117, 112], [116, 68, 64], [117, 117, 112], [117, 116, 112], [0, 32, 32], [0, 32, 33], [66, 18, 64], [7, 7, 0], [18, 66, 16], [116, 96, 32], [37, 81, 96], [37, 117, 80], [53, 53, 48], [97, 17, 96], [53, 85, 48], [113, 49, 112], [113, 49, 16], [97, 85, 96], [85, 117, 80], [114, 34, 112], [68, 69, 32], [85, 53, 80], [17, 17, 112], [87, 117, 80], [117, 85, 80], [37, 85, 32], [117, 113, 16], [101, 83, 96], [53, 53, 80], [97, 116, 48], [114, 34, 32], [85, 85, 112], [85, 82, 32], [85, 119, 80], [85, 37, 80], [85, 34, 32], [116, 33, 112], [98, 34, 96], [17, 36, 64], [50, 34, 48], [37, 0, 0], [0, 0, 112], [18, 0, 0], [6, 85, 96], [19, 85, 48], [6, 17, 96], [70, 85, 96], [2, 83, 96], [66, 114, 32], [2, 86, 66], [17, 53, 80], [2, 2, 32], [2, 2, 33], [21, 53, 80], [34, 34, 64], [5, 117, 80], [3, 85, 80], [2, 85, 32], [3, 85, 49], [6, 85, 100], [2, 81, 16], [6, 20, 48], [39, 34, 64], [5, 85, 96], [5, 82, 32], [5, 87, 80], [5, 34, 80], [5, 86, 66], [7, 65, 112], [98, 18, 96], [34, 34, 32], [50, 66, 48], [3, 96, 0]], P = (e, s, m = 3) => { |
2252 | 2260 | for (y = 0; y < 6; y++) for (x = 0; x < 4; x++) {
|
2253 | 2261 | let t = ~~(y / 2);
|
2254 |
| - (y % 2 ? s[t] & 15 : s[t] >> 4) & 1 << x && e.rectfill(x, y, 1, 1, p); |
2255 |
| - } |
2256 |
| - }, g = { id: "mini", chars: S, first: 33, w: 4, h: 6, render: P }; |
2257 |
| - var k = plugin = (e, { cache: s = true } = {}) => { |
2258 |
| - let p = e.text, t = e.textsize, c = e.textalign, z = e.textfont, i = s ? /* @__PURE__ */ new Map() : null, u = 1, r = null, N = (a) => { |
2259 |
| - u = ~~Math.round(a); |
2260 |
| - }, I = () => console.warn("[litecanvas/plugin-pixel-font] textalign() has not yet been implemented for pixel fonts"), w = (a, m, n, l = 3) => { |
2261 |
| - e.push(), e.translate(a, m), e.scale(u), r.render(e, n, l), e.pop(); |
2262 |
| - }, A = (a, m, n, l = 3) => { |
2263 |
| - if (n += "", !u || !n.length) return; |
2264 |
| - let o = u * r.w, b = u * (r.h || r.w); |
2265 |
| - for (let f = 0; f < n.length; f++) { |
2266 |
| - let _ = n[f], E = _.charCodeAt(), d = r.chars[E - r.first]; |
2267 |
| - if (d) if (s) { |
2268 |
| - let v = `${r.id}:${_}:${~~l}:${o}`; |
2269 |
| - i.has(v) || i.set(v, e.paint(o, b, () => { |
2270 |
| - w(0, 0, d, ~~l); |
| 2262 | + (y % 2 ? s[t] & 15 : s[t] >> 4) & 1 << x && e.rectfill(x, y, 1, 1, m); |
| 2263 | + } |
| 2264 | + }, h = { id: "mini", chars: S, first: 33, w: 4, h: 6, render: P }; |
| 2265 | + var _ = plugin = (e, { cache: s = true } = {}) => { |
| 2266 | + let m = e.text, t = e.textsize, l = e.textalign, k = e.textfont, o = s ? /* @__PURE__ */ new Map() : null, c = 1, r = null, g = (a) => { |
| 2267 | + c = ~~Math.round(a); |
| 2268 | + }, z = () => console.warn("[litecanvas/plugin-pixel-font] textalign() has not yet been implemented for pixel fonts"), N = (a, u, n, i = 3) => { |
| 2269 | + e.push(), e.translate(a, u), e.scale(c), r.render(e, n, i), e.pop(); |
| 2270 | + }, I = (a, u, n, i = 3) => { |
| 2271 | + if (e.stat(12) == null) throw "renderPixelText requires Litecanvas v0.99 or later"; |
| 2272 | + if (n += "", !c || !n.length) return; |
| 2273 | + let b = c * r.w, A = c * (r.h || r.w); |
| 2274 | + for (let p = 0; p < n.length; p++) { |
| 2275 | + let w = n[p], E = w.charCodeAt(), f = r.chars[E - r.first]; |
| 2276 | + if (f) if (s) { |
| 2277 | + let d = [r.id, w, ~~i, b, e.stat(12).join(",")].join(":"); |
| 2278 | + o.has(d) || o.set(d, e.paint(b, A, () => { |
| 2279 | + N(0, 0, f, ~~i); |
2271 | 2280 | }));
|
2272 |
| - let T = i.get(v); |
2273 |
| - e.image(a, m, T); |
2274 |
| - } else w(a, m, d, l); |
2275 |
| - a += o; |
| 2281 | + let T = o.get(d); |
| 2282 | + e.image(a, u, T); |
| 2283 | + } else N(a, u, f, i); |
| 2284 | + a += b; |
2276 | 2285 | }
|
2277 | 2286 | };
|
2278 | 2287 | if (s) {
|
2279 |
| - let m = setInterval(() => { |
2280 |
| - i.clear(); |
| 2288 | + let u = setInterval(() => { |
| 2289 | + o.clear(); |
2281 | 2290 | }, 6e4);
|
2282 | 2291 | e.listen("quit", () => {
|
2283 |
| - clearInterval(m), i.clear(); |
| 2292 | + clearInterval(u), o.clear(); |
2284 | 2293 | });
|
2285 |
| - let n = e.palc; |
2286 |
| - e.def("palc", (o, b) => (i.clear(), n(o, b))); |
2287 |
| - let l = e.pal; |
2288 |
| - e.def("pal", (o) => (i.clear(), l(o))); |
| 2294 | + let n = e.pal; |
| 2295 | + e.def("pal", (i) => (o.clear(), n(i))); |
2289 | 2296 | }
|
2290 | 2297 | return { textfont: (a) => {
|
2291 |
| - typeof a == "object" ? (e.def("text", A), e.def("textsize", N), e.def("textalign", I), r = a, N(u || 1)) : (e.def("text", p), e.def("textsize", t), e.def("textalign", c), z(a)); |
| 2298 | + typeof a == "object" ? (e.def("text", I), e.def("textsize", g), e.def("textalign", z), r = a, g(c || 1)) : (e.def("text", m), e.def("textsize", t), e.def("textalign", l), k(a)); |
2292 | 2299 | } };
|
2293 | 2300 | };
|
2294 |
| - window.pluginPixelFont = k; |
2295 |
| - window.PIXEL_FONT_MINI = g; |
2296 |
| - window.PIXEL_FONT_BASIC = h; |
| 2301 | + window.pluginPixelFont = _; |
| 2302 | + window.PIXEL_FONT_MINI = h; |
| 2303 | + window.PIXEL_FONT_BASIC = v; |
2297 | 2304 | })();
|
2298 | 2305 | })();
|
2299 | 2306 | /*! @litecanvas/utils by Luiz Bills | MIT Licensed */
|
|
0 commit comments