(Created page with "{{doc/start}} ==Usage== <pre> {{Minimap | xloc = Number | yloc = Number | icon = String | location = String }} </pre> ==Parameters== ; xloc: The...") |
No edit summary |
||
Line 38: | Line 38: | ||
==Notes== |
==Notes== |
||
− | * There is only one image for the minimap - it's the whole map resized to 2000px x 2000px |
+ | * There is only one image for the minimap - it's the whole map resized to 2000px x 2000px size. |
+ | [[File:MiniMapFull.jpg|thumb]] |
||
* Using CSS techniques, the minimap itself is a DIV element that is sized as exactly 300px x 300px. The map image is set as the background for the DIV and an offset is specified, so that it shows the correct section of the map. |
* Using CSS techniques, the minimap itself is a DIV element that is sized as exactly 300px x 300px. The map image is set as the background for the DIV and an offset is specified, so that it shows the correct section of the map. |
||
* The icon specified should always be shown centered on the minimap - there was an issue when getting this to work inside an infobox, so a workaround was implemented whereby all the minimap versions of the icons are 300px x 32px with a transparent area. The icons also had a black stroke/border applied so that they are more visible. They are all named the same as the standard icons, but with "Mini " prefixed to the filename. |
* The icon specified should always be shown centered on the minimap - there was an issue when getting this to work inside an infobox, so a workaround was implemented whereby all the minimap versions of the icons are 300px x 32px with a transparent area. The icons also had a black stroke/border applied so that they are more visible. They are all named the same as the standard icons, but with "Mini " prefixed to the filename. |
||
Line 45: | Line 46: | ||
==Example== |
==Example== |
||
This example is taken from the Location infobox template and uses values passed to that template to transclude the Minimap template. |
This example is taken from the Location infobox template and uses values passed to that template to transclude the Minimap template. |
||
+ | <pre> |
||
{{Minimap |
{{Minimap |
||
| xloc = {{#expr: (({{#explode:{{{Coords}}}|,|0}} + 342) * -2.45) + 150 }} |
| xloc = {{#expr: (({{#explode:{{{Coords}}}|,|0}} + 342) * -2.45) + 150 }} |
||
Line 51: | Line 53: | ||
| location = {{{Name}}} |
| location = {{{Name}}} |
||
}} |
}} |
||
+ | </pre> |
||
− | |||
{{doc/end}} |
{{doc/end}} |
Revision as of 11:06, 24 May 2018
Usage
{{Minimap | xloc = Number | yloc = Number | icon = String | location = String }}
Parameters
- xloc
- The horizontal offset of the map image
- yloc
- The vertical offset of the map image
- icon
- The icon to display in the center of the minimap. E.g. "mini T Map Icon vista.png"
- location
- The text name of the location (optional) - this should be displayed as an ALT tag when the user hovers over the icon.
CSS styling
There is specific CSS styling set within MediaWiki:Common.css
/* This is styling for the minimap template */ .minimap { width: 300px; height: 300px; display:table-cell; vertical-align: middle; text-align: center; border: none; background-image: url('https://d1u5p3l4wpay3k.cloudfront.net/conanexiles_gamepedia/f/fb/MiniMapFull.jpg'); background-repeat: no-repeat; } .minimap img { float: none; display:inline-block; }
Notes
- There is only one image for the minimap - it's the whole map resized to 2000px x 2000px size.
- Using CSS techniques, the minimap itself is a DIV element that is sized as exactly 300px x 300px. The map image is set as the background for the DIV and an offset is specified, so that it shows the correct section of the map.
- The icon specified should always be shown centered on the minimap - there was an issue when getting this to work inside an infobox, so a workaround was implemented whereby all the minimap versions of the icons are 300px x 32px with a transparent area. The icons also had a black stroke/border applied so that they are more visible. They are all named the same as the standard icons, but with "Mini " prefixed to the filename.
- To convert from in-game coordinates to the offset required, some maths needs to be applied. Take the in-game X,Y coordinate , add +342, +446. Then multiply by -2.45 and add +150, +150 (see the example below).
Example
This example is taken from the Location infobox template and uses values passed to that template to transclude the Minimap template.
{{Minimap | xloc = {{#expr: (({{#explode:{{{Coords}}}|,|0}} + 342) * -2.45) + 150 }} | yloc = {{#expr: (({{#explode:{{{Coords}}}|,|1}} + 446) * -2.45) + 150 }} | icon = Mini {{{MapIcon}}} | location = {{{Name}}} }}
This is the documentation page, it should be transcluded into the main template page. See Template:Doc for more information.