Wynncraft Wiki
SLScool (talk | contribs)
(Second attempt)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:x|{{{x|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 0 }}}}}}{{#vardefine:y|{{{y|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 1 }}}}}}{{#vardefine:z|{{{z|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 2 }}}}}}<!--
+
<includeonly>{{#vardefine:x|{{{x|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 0 }}}}}}<!--Defines the x-coordinate variable as the x parameter or the first number in the coordinates parameter
  +
-->{{#vardefine:z|{{{z|}}}{{trim|{{#explode: {{{coordinates|}}} |,| -1 }}}}}}<!--Defines the z-coordinate variable as the z parameter if it exists or the last number in the coordinates parameter
-->{| style="text-align: center; {{#if:{{{image_only|}}}||margin: 8px;}} border: 1px solid #333333; padding: 0;"
 
  +
-->{{#if:{{{y|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 2 }}}}|{{#vardefine:y|{{{y|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 1 }}}}}}}}<!--If the y parameter is used or if there are three numbers in the coordinates parameter, then the y-coordinate variable is defined as the y parameter or the second number in the coordinates parameter
 
-->{| style="{{{style|}}} text-align: center; {{#if:{{{image_only|}}}||margin: 8px;}} border: 1px solid #333333; padding: 0; min-width: 150px; {{#if:{{{inline-block|}}}|display: inline-block;}}"
 
{{#if:{{{image_only|}}}||{{!}}style="line-height:1.5; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 120%"{{!}} '''{{{locationLabel|Location}}}'''
 
{{#if:{{{image_only|}}}||{{!}}style="line-height:1.5; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 120%"{{!}} '''{{{locationLabel|Location}}}'''
 
{{!-}}
 
{{!-}}
{{!}}style="line-height:1.5; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a;"{{!}}{{#if:{{{location|}}}|{{{location|}}} <br>}} <span style="user-select: all">{{{coordinates|}}}{{#if:{{{x|}}}|{{trim|{{{x|}}}}}, {{trim|{{{y|}}}}}, {{trim|{{{z|}}}}}}}</span>
+
{{!}}style="line-height:1.5; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a;"{{!}}{{#if:{{{location|}}}|{{{location|}}} <br>}} <span style="user-select: all">{{{coordinates|}}}{{#if:{{{coordinates|}}}||{{#if:{{{y|}}}|{{trim|{{{x|}}}}}, {{trim|{{{y|}}}}}, {{trim|{{{z|}}}}}|{{trim|{{{x|}}}}}, {{trim|{{{z|}}}}}}}}}</span>
 
{{!-}}}}
 
{{!-}}}}
{{#ifexpr: {{#var:x|10000}} < 2000 and {{#var:x|-10000}} > -2400 and {{#var:z|10000}} > -6800 and {{#var:z|-10000}} < 0||<div style="position:relative; top:0; left:0;"><span class="sprite " style="
+
{{#ifexpr: {{#var:x|10000}} < 2000 and {{#var:x|-10000}} > -2400 and {{#var:z|10000}} > -6800 and {{#var:z|-10000}} < 0|{{!}}<div style="position:relative; top:0; left:0;"><span class="sprite " style="
 
background-image: {{FileUrl|File:TopographicMap.jpg}};
 
background-image: {{FileUrl|File:TopographicMap.jpg}};
 
display: inline-block;
 
display: inline-block;
Line 18: Line 20:
 
position: relative
 
position: relative
 
"></span>{{#if:{{{no_crosshair|}}}||<span style="position:absolute; top:{{#expr: {{#expr:{{{width|200}}} / 2}} - 18}}px; left:{{#expr: {{#expr:{{{height|200}}} / 2}} - 18}}px;">[[File:PinpointConcept2.png|link=]]</span>}}</div>
 
"></span>{{#if:{{{no_crosshair|}}}||<span style="position:absolute; top:{{#expr: {{#expr:{{{width|200}}} / 2}} - 18}}px; left:{{#expr: {{#expr:{{{height|200}}} / 2}} - 18}}px;">[[File:PinpointConcept2.png|link=]]</span>}}</div>
  +
{{!-}}
|-
 
 
{{#if:{{{image_only|}}}||{{!}}style="border-top: 1px solid #333333" {{!}}[https://map.wynncraft.com/#/{{#var:x}}/{{#var:y|50}}/{{#var:z}}/-2/wynn-main/Wynncraft Wynncraft Map]}}}}
 
{{#if:{{{image_only|}}}||{{!}}style="border-top: 1px solid #333333" {{!}}[https://map.wynncraft.com/#/{{#var:x}}/{{#var:y|50}}/{{#var:z}}/-2/wynn-main/Wynncraft Wynncraft Map]}}}}
 
|}</includeonly><noinclude>{{doc}}[[Category:Table templates]]</noinclude>
 
|}</includeonly><noinclude>{{doc}}[[Category:Table templates]]</noinclude>

Latest revision as of 00:53, 20 August 2021

Template-info.png Documentation

A location and coordinate display template similar to Template:Location, but has a different appearance. Most importantly, it also renders a portion of File:TopographicMap.jpg with a red crosshair on the coordinates, giving the reader a visual idea of where the coordinates are in the world.

Usage

All of the parameters are the same between this template and Template:Location, so swapping between the two templates is easy.

{{RenderLocation
<!-- REQUIRED PARAMETERS -->
| locationLabel = 
| location =
| coordinates = comma-separated list
OR
| x = 
| y = 
| z = 

<!-- OPTIONAL PARAMETERS -->
| width =
| height = 
| no_crosshair = 
| image_only = 
| inline-block = 
| style =
}}
  • locationLabel - defaults to "Location". Controls the bolded header text at the top of the display.
  • location - Controls the location name next to the coordinates.
  • coordinates or xyz - the coordinate input. You can either input a comma-separated list of coordinates, or input each coordinate individually.

The following parameters are optional and should not be used in most cases. They can be used to really customize the display.

  • width and height - Optional. Controls the width and height of the area to display.
  • no_crosshair - Optional. If true, doesn't render a red crosshair in the center of the image.
  • image_only - Optional. If true, doesn't display the location label, coordinates, or Wynncraft Map link, only the image.
  • inline-block - Optional. If true, gives the table the "display: inline-block" styling. Essentially, this makes consecutive RenderLocations appear beside each other instead of on new lines.
  • style - Optional. Use for any other css properties you want to define for the table.

Examples

{{RenderLocation
| location = Tolem
| coordinates = -1663, 53, -5271	
}}
Location
Tolem
-1663, 53, -5271
PinpointConcept2.png
Wynncraft Map
{{RenderLocation
| locationLabel = Spawn Node
| location = Gateway to Nothing
| coordinates = 1199, 75, -967
}}
Spawn Node
Gateway to Nothing
1199, 75, -967
PinpointConcept2.png
Wynncraft Map
{{RenderLocation
| locationLabel = Town
| location = Nemract
| coordinates = 128, 48, -2197
| width = 500
| height = 400
| no_crosshair = yes
| image_only = yes
}}