Advertisement
Nyanderful

PixelGame Overlay v3

Jan 16th, 2023
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         PixelGame Pixel Canvas | Overlay
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1.0
  5. // @description  try to take over the canvas!
  6. // @author       Nyanderful
  7. // @match        https://pixelgame-production.up.railway.app/*
  8. // @icon         https://www.google.com/s2/favicons?sz=64&domain=pixilart.com/
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. //scources are [source,Xpos,Ypos]
  13. let sources = [
  14.     //You only need to add your pixelart here, use the bottom as an example.
  15.     //remove the // to preview below and play around with it.
  16.     //["https://i.imgur.com/PxrPSDV.png", "-100px" , "0px"],
  17. ];
  18.  
  19. let imgMask = "url(https://i.imgur.com/RRC3qXG.png)"
  20.  
  21. //PixelGame Overlay
  22. window.addEventListener('load', () => {
  23.     //create div
  24.     let overlay = document.createElement("div");
  25.     overlay.style.position = "absolute";
  26.     overlay.style.top = "0px";
  27.     overlay.style.left = "0px";
  28.     overlay.style.transform = "scale(100)";
  29.     overlay.style["z-index"] = "9001";
  30.     overlay.id = "preview-overlay";
  31.     document.getElementById('zoom').appendChild(overlay)
  32.     //add all the images here
  33.     for (let Index = 0; Index < sources.length; Index ++){
  34.         const i = document.createElement("img");
  35.         const time = Math.floor(Date.now() / 100000);
  36.         // Image Settings
  37.         i.style = "position: absolute;";
  38.         i.style["image-rendering"] = "pixelated";
  39.         // POSITIONING //
  40.         i.style.left = sources[Index][1]; //X coords
  41.         i.style.top = sources[Index][2]; //Y coords
  42.         i.src = sources[Index][0] + "?raw=true?tstamp=" + time;
  43.         // MASKING //
  44.         i.style["-webkit-mask-image"] = imgMask; // mask url
  45.         i.style["-webkit-mask-size"] = "1px"; // mask size (1px obviously)
  46.         i.style["pointer-events"] = "none";
  47.         console.log(i);
  48.         document.getElementById('preview-overlay').appendChild(i)
  49.     }
  50. }, true);
Tags: PixelGame
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement