Arbybear

Tagpro Transparent Canvas + Background Changer

Mar 8th, 2015
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name          Tagpro Transparent Canvas + Background Changer
  3. // @namespace     http://www.reddit.com/user/newcompte/
  4. // @include       http://tagpro-*.koalabeast.com:*
  5. // @include       http://tangent.jukejuice.com:*
  6. // @include       http://*.newcompte.fr:*
  7. // @author        NewCompte, Ruud, Arbybear
  8.  
  9. // ==/UserScript==
  10.  
  11. // Set this to false if you don't want a transparent viewport. If you chose an "outside" border, an opaque viewport will cover the border.
  12. var transparent = true;
  13.  
  14. // Replace the url here either with one of the others below, or your own background.
  15. $('html').css({'background-image':'url(https://i.imgur.com/aXMSkv7.png)'});
  16.  
  17. /* Default background http://tagpro-radius.koalabeast.com/images/background.jpg
  18.  
  19.        "Under" borders. If you are in the middle of a large map, you won't be able to see the border.
  20.  
  21.               White percentage of border, opacity percentage, url.
  22.  
  23.               100, 100, https://i.imgur.com/Ay6V7Ki.png
  24.               75, 100, https://i.imgur.com/T4q3UtX.png
  25.               65, 100, https://i.imgur.com/wPN0vzj.png
  26.               50, 100, https://i.imgur.com/Ur9n2g3.png
  27.               75, 40, https://i.imgur.com/aXMSkv7.png - default
  28.  
  29.        "Outside" borders. You can always see the border.
  30.  
  31.               White percentage of border, opacity percentage, url.
  32.  
  33.               100, 100, https://i.imgur.com/Gzw7ddR.png
  34.               75, 100, https://i.imgur.com/4nz0M7u.png
  35.               65, 100, https://i.imgur.com/AgXJ6Vm.png
  36.               50, 100, https://i.imgur.com/DH47d8I.png
  37.               75, 40, https://i.imgur.com/Dc54EPV.png
  38.  
  39. _____________________________________________Don't change anything past here!_________________________________________*/
  40.  
  41. tagpro.ready(function () {
  42.    var oldCanvas = $(tagpro.renderer.canvas);
  43.    var newCanvas = $('<canvas id="viewport" width="1280" height="800"></canvas>');
  44.    oldCanvas.after(newCanvas);
  45.    oldCanvas.remove();
  46.    tagpro.renderer.canvas = newCanvas.get(0);
  47.    tagpro.renderer.options.transparent = transparent;
  48.    tagpro.renderer.renderer = tagpro.renderer.createRenderer();
  49.    tagpro.renderer.resizeAndCenterView();
  50.    newCanvas.show();
  51. });
Add Comment
Please, Sign In to add comment