Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name PixelGame Pixel Canvas | Overlay
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description try to take over the canvas!
- // @author Nyanderful
- // @match https://pixelgame-production.up.railway.app/*
- // @icon https://www.google.com/s2/favicons?sz=64&domain=pixilart.com/
- // @grant none
- // ==/UserScript==
- //scources are [source,Xpos,Ypos]
- let sources = [
- //You only need to add your pixelart here, use the bottom as an example.
- //remove the // to preview below and play around with it.
- //["https://i.imgur.com/PxrPSDV.png", "-100px" , "0px"],
- ];
- let imgMask = "url(https://i.imgur.com/RRC3qXG.png)"
- //PixelGame Overlay
- window.addEventListener('load', () => {
- //create div
- let overlay = document.createElement("div");
- overlay.style.position = "absolute";
- overlay.style.top = "0px";
- overlay.style.left = "0px";
- overlay.style.transform = "scale(100)";
- overlay.style["z-index"] = "9001";
- overlay.id = "preview-overlay";
- document.getElementById('zoom').appendChild(overlay)
- //add all the images here
- for (let Index = 0; Index < sources.length; Index ++){
- const i = document.createElement("img");
- const time = Math.floor(Date.now() / 100000);
- // Image Settings
- i.style = "position: absolute;";
- i.style["image-rendering"] = "pixelated";
- // POSITIONING //
- i.style.left = sources[Index][1]; //X coords
- i.style.top = sources[Index][2]; //Y coords
- i.src = sources[Index][0] + "?raw=true?tstamp=" + time;
- // MASKING //
- i.style["-webkit-mask-image"] = imgMask; // mask url
- i.style["-webkit-mask-size"] = "1px"; // mask size (1px obviously)
- i.style["pointer-events"] = "none";
- console.log(i);
- document.getElementById('preview-overlay').appendChild(i)
- }
- }, true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement