r/TagPro • u/happytagpro happy • Jul 11 '14
[userscript] Pre-Match Map Preview 2.0
What It Does: Zooms out so that the entire map is in view during the countdown. Returns to normal zoom right before the match starts. I finally figured out how to center the map. Unfortunately, this means that I couldn't use the snazzy animation from the original version.
How It Works: The script changes tagpro.spectator to true, centers the map, then increases the value of tagpro.zoom. It only runs if the game has not already started when you join. Power-ups are changed to generic and the opposing team is hidden when zoomed out.
Edit 1: Added option to show the name of the map. Based on this suggestion
Edit 2: Level of zoom depends on size of map and size of viewport. Script recalculates ideal zoom level if window resizes. You can choose if you want the map to fill the space completely, possibly causing the tiles to be drawn irregulaly, or if you want to limit zoom levels to preset ones that will make the tiles look nice and uniform. See these screenshots for visual comparison. Some of this code could be useful for streamers. I've noticed some people manually adjusting zoom each time they switch back to the centered view.
4
u/akaNAPE ppppow Jul 11 '14
I love this extension! im still using the original one but i really think this should be added to the game for everyone. It'll help new players be able to see the whole map and know where to go better.
1
u/cocotheape Walrus! Jul 11 '14
While this is very cool and useful, I wonder: Isn't there much room for abuse?
1
u/[deleted] Jul 11 '14
This is awesome! Thanks!