SVG workarounds: Difference between revisions

From Warzone Wiki
Jump to navigation Jump to search
Moros (talk | contribs)
Added section about converting texts. I know this has already been mentioned on other pages on this wiki, but I plan to add a lot more of these tutorials to this page.
No edit summary
 
Line 1: Line 1:
This page lists the SVG workarounds you may need to use to get your [[map]] working in WarLight.
This page lists the SVG workarounds you may need to use to get your [[map]] working in Warzone.


==ViewBox Fix==
==ViewBox Fix==


WarLight currently has a hard time understanding SVG files that have setting for an SVG's width and height from its view box.  This can cause maps to appear incorrectly sized when uploaded to WarLight, or to not appear at all if they are so much larger than the screen that all of the territories are off-screen.
Warzone currently has a hard time understanding SVG files that have setting for an SVG's width and height from its view box.  This can cause maps to appear incorrectly sized when uploaded to Warzone, or to not appear at all if they are so much larger than the screen that all of the territories are off-screen.


To check if this is causing an issue or to fix it, follow these steps:
To check if this is causing an issue or to fix it, follow these steps:
Line 15: Line 15:
## height = 400
## height = 400
## viewBox = 0 0 900 400
## viewBox = 0 0 900 400
# If the viewBox isn't rooted at 0,0 or if its width and height don't match the others, simply change the viewBox by selecting it, typing in the correct numbers, and clicking set.  After doing this, your map will likely shift all of its territories to different locations.  Now you should  select all of the territories and move/resize them to fit them back within the box.  After doing this, the map should work correctly in WarLight.
# If the viewBox isn't rooted at 0,0 or if its width and height don't match the others, simply change the viewBox by selecting it, typing in the correct numbers, and clicking set.  After doing this, your map will likely shift all of its territories to different locations.  Now you should  select all of the territories and move/resize them to fit them back within the box.  After doing this, the map should work correctly in Warzone.


==Text==
==Text==


Warlight doesn't support the plain text you can type in in most SVG editors. They won't show. So you'll need to transfer them to paths. That can be done this way:
Warzone doesn't support the plain text you can type in in most SVG editors. They won't show. So you'll need to transfer them to paths. That can be done this way:
# Open the SVG file in Inkscape.
# Open the SVG file in Inkscape.
# Select the text you want to transfer.
# Select the text you want to transfer.
# Open the menu "Paths", and from there the option at the top: "Object to Path" Click it.
# Open the menu "Paths", and from there the option at the top: "Object to Path" Click it.
Now re-upload the map to Warlight and you're done!
Now re-upload the map to Warzone and you're done!


[[Category:Map Making|Workarounds]]
[[Category:Map Making|Workarounds]]

Latest revision as of 03:39, 13 November 2017

This page lists the SVG workarounds you may need to use to get your map working in Warzone.

ViewBox Fix

Warzone currently has a hard time understanding SVG files that have setting for an SVG's width and height from its view box. This can cause maps to appear incorrectly sized when uploaded to Warzone, or to not appear at all if they are so much larger than the screen that all of the territories are off-screen.

To check if this is causing an issue or to fix it, follow these steps:

  1. Open the SVG file in Inkscape
  2. Open the XML Editor (4th button from the top right)
  3. Click on the top-most node (it should start with svg:svg)
  4. Inspect the "width", "height" and "viewBox" attributes. ViewBox should have 4 numbers, which represent (in order): x, y, width, height
  5. The viewBox should be set to 0 and 0 for x and y, and to the same values as width and height. For example, these settings are correct:
    1. width = 900
    2. height = 400
    3. viewBox = 0 0 900 400
  6. If the viewBox isn't rooted at 0,0 or if its width and height don't match the others, simply change the viewBox by selecting it, typing in the correct numbers, and clicking set. After doing this, your map will likely shift all of its territories to different locations. Now you should select all of the territories and move/resize them to fit them back within the box. After doing this, the map should work correctly in Warzone.

Text

Warzone doesn't support the plain text you can type in in most SVG editors. They won't show. So you'll need to transfer them to paths. That can be done this way:

  1. Open the SVG file in Inkscape.
  2. Select the text you want to transfer.
  3. Open the menu "Paths", and from there the option at the top: "Object to Path" Click it.

Now re-upload the map to Warzone and you're done!