glow.js & hotfix for support
This commit is contained in:
parent
1fb0f79fb0
commit
214eef95ed
11
index.html
11
index.html
|
|
@ -703,9 +703,13 @@ SEEDRISE: function(pixel) {
|
|||
if (!pixel.charge && !pixel.chargeCD) {
|
||||
alpha -= 0.75;
|
||||
alpha = Math.max(0,alpha);
|
||||
if (pixel.emit) pixel.emit = false;
|
||||
if (alpha === 0) return;
|
||||
}
|
||||
else { alpha = 1 }
|
||||
else {
|
||||
alpha = 1;
|
||||
if (!pixel.emit) pixel.emit = true;
|
||||
}
|
||||
drawSquare(ctx,pixel.color,pixel.x,pixel.y,undefined,alpha);
|
||||
}
|
||||
}
|
||||
|
|
@ -13020,6 +13024,9 @@ if (langCode) {
|
|||
if (pixel.alpha !== undefined) {
|
||||
delete pixel.alpha;
|
||||
}
|
||||
if (pixel.emit) {
|
||||
delete pixel.emit;
|
||||
}
|
||||
if (elements[element].alpha !== undefined) {
|
||||
pixel.alpha = elements[element].alpha;
|
||||
}
|
||||
|
|
@ -18031,7 +18038,7 @@ Cancer, Landmine, Grenade, Smoke Grenade">?</span>
|
|||
<!-- <p>If you'd like to support us, consider donating on <a href="https://www.paypal.com/donate/?hosted_button_id=GCX4VHQ7SZWTN" target="_blank">PayPal</a> or <a href="https://cash.app/$emojiartist" target="_blank" title="$emojiartist">CashApp</a>, or subscribing on Discord.</p> -->
|
||||
<p>Business inquiries? Education stories? Help needed? Email us at <a href="mailto:contact@R74n.com?subject=%5BSandboxels%5D">contact@R74n.com</a>!</p>
|
||||
<p>More links: <a href="https://sandboxels.R74n.com/help" rel="help">Help</a> • <a href="https://sandboxels.R74n.com/tips">Tips</a> • <a href="https://sandboxels.R74n.com/mod-list">Mods</a> • <a href="https://sandboxels.R74n.com/mobile-use">Mobile</a> • <a href="https://sandboxels.R74n.com/offline-use">Offline</a> • <a href="https://R74n.com/privacy">Privacy</a></p>
|
||||
<p>Thanks to our Patrons: Serioustar, ggod, Midi_png, personman, fnl4y, PitsPower, swagg boi, moss, Suss, WeiChei, Trent, u2ce</p>
|
||||
<p>Thanks to our Patrons: Serioustar, ggod, Midi_png, personman, fnl4y, PitsPower, swagg boi, moss, Suss, epsiloneridani, WeiChei, Trent, u2ce</p>
|
||||
<p style="display:none" id="langCredit">Translation by R74n</p>
|
||||
<p>Sandboxels is developed by R74n. Check out <a href="https://R74n.com" rel="author" target="_blank">our other projects</a>!</p>
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -314,6 +314,9 @@ renderEachPixel(function(pixel,ctx) {
|
|||
drawSquare(devtestsCtx2,elements[pixel.element].emitColor||pixel.color,pixel.x-r,pixel.y-r,d,a);
|
||||
// viewInfo[1].pixel(pixel,devtestsCtx2);
|
||||
}
|
||||
if (pixel.charge && !elements[pixel.element].colorOn) {
|
||||
drawSquare(devtestsCtx2,"#ffff00",pixel.x-1,pixel.y-1,3);
|
||||
}
|
||||
}
|
||||
// else if (view === 7) {
|
||||
// let a = (settings.textures !== 0) ? pixel.alpha : undefined;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
addCanvasLayer("glowmod");
|
||||
addCanvasLayer("glowmod2");
|
||||
canvasLayersPre.unshift(canvasLayers["glowmod"]);
|
||||
glowmodCtx = canvasLayers["glowmod"].getContext("2d");
|
||||
glowmodCtx2 = canvasLayers["glowmod2"].getContext("2d");
|
||||
delete canvasLayers.glowmod;
|
||||
delete canvasLayers.glowmod2;
|
||||
|
||||
elements.fire.emit = true;
|
||||
elements.lightning.emit = 15;
|
||||
elements.electric.emit = true;
|
||||
elements.plasma.emit = true;
|
||||
elements.uranium.emit = 3;
|
||||
elements.uranium.emitColor = "#009800";
|
||||
elements.rainbow.emit = true;
|
||||
elements.static.emit = true;
|
||||
elements.flash.emit = true;
|
||||
elements.cold_fire.emit = true;
|
||||
elements.blaster.emit = true;
|
||||
elements.ember.emit = true;
|
||||
elements.fw_ember.emit = 10;
|
||||
elements.bless.emit = true;
|
||||
elements.pop.emit = true;
|
||||
elements.explosion.emit = true;
|
||||
elements.n_explosion.emit = 10;
|
||||
elements.supernova.emit = 20;
|
||||
elements.midas_touch.emit = true;
|
||||
elements.fireball.emit = true;
|
||||
elements.sun.emit = 15;
|
||||
elements.light.emit = 3;
|
||||
elements.liquid_light.emit = true;
|
||||
elements.laser.emit = 3;
|
||||
elements.neutron.emit = 3;
|
||||
elements.proton.emit = 3;
|
||||
elements.radiation.emit = 3;
|
||||
elements.fallout.emit = 3;
|
||||
elements.rad_steam.emit = 2;
|
||||
elements.rad_steam.emitColor = "#6ad48c";
|
||||
elements.rad_cloud.emit = 2;
|
||||
elements.rad_cloud.emitColor = "#009800";
|
||||
elements.rad_glass.emit = 2;
|
||||
elements.rad_glass.emitColor = "#009800";
|
||||
elements.rad_shard.emit = 2;
|
||||
elements.rad_shard.emitColor = "#009800";
|
||||
elements.malware.emit = 2;
|
||||
elements.border.emit = 2;
|
||||
|
||||
viewInfo[1] = { // Blur Glow (Emissive pixels only)
|
||||
name: "",
|
||||
pixel: viewInfo[1].pixel,
|
||||
effects: true,
|
||||
colorEffects: true,
|
||||
pre: function(ctx) {
|
||||
glowmodCtx2.canvas.width = ctx.canvas.width;
|
||||
glowmodCtx2.canvas.height = ctx.canvas.height;
|
||||
},
|
||||
pixel: viewInfo[1].pixel,
|
||||
post: function(ctx) {
|
||||
glowmodCtx.canvas.width = ctx.canvas.width;
|
||||
glowmodCtx.canvas.height = ctx.canvas.height;
|
||||
glowmodCtx.filter = "blur(30px)";
|
||||
// Draw the blurred content on the canvas
|
||||
glowmodCtx.drawImage(glowmodCtx2.canvas, 0, 0);
|
||||
glowmodCtx.filter = "none";
|
||||
},
|
||||
};
|
||||
|
||||
renderEachPixel(function(pixel,ctx) {
|
||||
if (view === 1) {
|
||||
if (elements[pixel.element].emit || pixel.emit || (elements[pixel.element].colorOn && pixel.charge)) {
|
||||
let a = (settings.textures !== 0) ? pixel.alpha : undefined;
|
||||
let d = elements[pixel.element].emit||true;
|
||||
if (d === true) d = 5;
|
||||
let r = Math.floor(d/2);
|
||||
drawSquare(glowmodCtx2,elements[pixel.element].emitColor||pixel.color,pixel.x-r,pixel.y-r,d,a);
|
||||
}
|
||||
if (pixel.charge && !elements[pixel.element].colorOn) {
|
||||
drawSquare(glowmodCtx2,"#ffff00",pixel.x-1,pixel.y-1,3);
|
||||
}
|
||||
}
|
||||
})
|
||||
Loading…
Reference in New Issue