Monday, September 27, 2010

Map Shifter

I've been shifting my maps by hand. For example, I'd create things centered at Y=300 and then add 100 to every Y-value when I was finished so I could hide all the mechanics. This was relatively quick and painless, but if I wanted to shift by 50 or 55 it would require a bit more thinking--simple arithmetic, but quite time-consuming.

So, I finally decided to learn some javascript and came up with the following map shifter. You just need to paste the map code into the box, specify the shift amounts (positive x and y values correspond to shifting right and down), and click "Get Code". Then the code for the shifted map will be pasted into the second box. You can copy the code easily by clicking in the box, pressing Ctrl-a to select all, then Ctrl-c to copy. I might add support for mirroring maps (flipping them about X=400) later, although it's a bit more complicated.

Edit: I've added a flip option, which will take place after the shift. If you have any problems, let me know in the comments.

November 2011 update: Both shifting and flipping should work now, and flipping should work on scrolling maps. However, you'll still have to do runes manually.


Paste your map code here:
Newlines: Flip: X-shift: Y-shift:

Here's the code for your shifted map:

16 comments:

  1. I just realize, that you should have button "send shifted map up" or that shifted map should appear the same textedit it is.
    Why, asking you, and i answer - try to ajust some map to the center of the screen, and you will certaninly agree with me then.

    ReplyDelete
  2. We've talked about this, but I'll add my comments here anyway.

    I don't think such a button is necessary. My idea is that a person will finish their map and will only need to shift everything to get it perfectly centered. They'll paste their map in the top box and first shift it by 30, then if that was too much, maybe by 25. I think that leaving the original map in the top box is better than replacing it with a modified version and then adjusting that one by -5. What if after all the changes they decide they want to stick with the original? As is, that code will still be in the top box. So, those are my thoughts.

    ReplyDelete
  3. Runes don't flip properly. It's a pain to fix, so I won't fix it. You'll have to adjust their angles by hand.

    ReplyDelete
  4. This really helps. Thank you so much; I use it all the time and have this bookmarked.

    ReplyDelete
  5. Very helpful going to try it out now, thanks!

    ReplyDelete
  6. Perfect, thank you so much .. Bookmarked.

    ReplyDelete
  7. Yay this helped..thank you! :D

    ReplyDelete
  8. Very helpful, bookmarked :)

    ReplyDelete
  9. I always use this, so helpful :)

    ReplyDelete
  10. Thanks so much for all, the Map Shifter (I used it alot), map xmls (I used alot to see how your maps worked) and the mapmaking numbers (just very usefull) Thanks for all! :)

    ReplyDelete
  11. Temple, center map.

    ReplyDelete
  12. Hi temple,i have a one question:
    You teach me to make maps?

    (My english is very bad because i from Brazil and I did not get anything from google translator)

    Please,answer me in the game, this is my nickname up there

    ReplyDelete