Difference between revisions of "Template:UO Image"

m
m
Line 3: Line 3:
 
</noinclude>
 
</noinclude>
  
<includeonly>{{#ifeq: {{{1|}}}|map|{{#ifexpr:{{#ifeq:{{{5}}}|N|1|0}} or {{#ifeq:{{{5}}}|S|1|0}}|convert|
+
<includeonly>{{#ifeq: {{{1|}}}|map|{{#ifexpr:{{#ifeq:{{{5}}}|N|1|0}} or {{#ifeq:{{{5}}}|S|1|0}}|{{#if: true| <!-- This does the work to convert sextant coordinates to tile coordinates.
 +
 
 +
Maps:
 +
1 = Britannia (Tram or Fel)
 +
2 = Lost Lands
 +
3 = Ilshenar
 +
 
 +
START COORDINATE CONVERSION CODE -->
 +
{{#arraydefine:split|{{{4}}}}}
 +
{{#vardefine: y1|{{#arrayindex:split|0}}}}
 +
{{#vardefine: y2|{{#arrayindex:split|1}}}}
 +
{{#vardefine: y3|{{{5}}}}}
 +
{{#arraydefine:split|{{{6}}}}}
 +
{{#vardefine: x1|{{#arrayindex:split|0}}}}
 +
{{#vardefine: x2|{{#arrayindex:split|1}}}
 +
{{#vardefine: x3|{{{7}}}}}
 +
{{#vardefine:map|{{{3}}}}}
 +
{{#vardefine: height|{{#switch: {{#var:map}}
 +
| 1 = 4096
 +
| 2 = 4096
 +
| 3 = 1600
 +
}} }}
 +
{{#vardefine: centerY|{{#switch: {{#var:map}}
 +
| 1 = 1624
 +
| 2 = 3112
 +
| 3 =
 +
}} }}
 +
{{#vardefine: width|{{#switch: {{#var:map}}
 +
| 1 = 5120
 +
| 2 = 5120
 +
| 3 = 2304
 +
}} }}
 +
{{#vardefine: centerX|{{#switch: {{#var:map}}
 +
| 1 = 1323
 +
| 2 = 5936
 +
| 3 =
 +
}} }}
 +
{{#vardefine: y|{{#expr:{{#expr:{{#var:y1}}*100}}+{{#expr:{{#expr:{{#var:y2}}*10}}/6}}}}}}
 +
{{#vardefine: y|{{#ifeq: {{#var:y3}}|N|{{#expr:36000-{{#var:y}}|{{#var:y}} }} }} }}
 +
{{#vardefine: y|{{#expr:{{#var:y}}*{{#var:height}}}}}}
 +
{{#vardefine: y|{{#expr:{{#var:y}}/36000}}}}
 +
{{#vardefine: y|{{#expr:{{#var:centerY}}+{{#var:y}}}}}}
 +
{{#vardefine: y|{{#expr:{{#var:y}} mod {{#var:height}}}}}}
 +
{{#vardefine: x|{{#expr:{{#expr:{{#var:x1}}*100}}+{{#expr:{{#expr:{{#var:x2}}*10}}/6}}}}}}
 +
{{#vardefine: x|{{#ifeq: {{#var:x3}}|W|{{#expr:36000-{{#var:x}}|{{#var:x}} }} }} }}
 +
{{#vardefine: x|{{#expr:{{#var:x}}*{{#var:width}}}}}}
 +
{{#vardefine: x|{{#expr:{{#var:x}}/36000}}}}
 +
{{#vardefine: x|{{#expr:{{#var:centerX}}+{{#var:x}}}}}}
 +
{{#vardefine: x|{{#expr:{{#var:x}} mod {{#var:width}}}}}}
 +
 
 +
<!-- END COORDINATE CONVERSION CODE  -->
 +
}}{{UO_Image|map|{{{1}}}|{{#var:x}}|{{#var:y}}{{{8|}}}|{{{9|}}}}}|
 
<div style="display:inline-block;"><div style="position: relative;width:{{#expr:{{{5|175}}}*2}}px;height:{{#expr:{{{5|175}}}*2}}px;overflow: hidden;display:inline-block;"><div style="-webkit-clip-path: circle({{{5|175}}}px at {{{3}}}px {{{4}}}px); clip-path: circle({{{5|175}}}px at {{{3}}}px {{{4}}}px); transform: translate({{#expr: {{{5|175}}}-{{{3}}} }}px,{{#expr: {{{5|175}}}-{{{4}}} }}px);">[[File:MAP{{#switch: {{lc:{{{2|}}} }}
 
<div style="display:inline-block;"><div style="position: relative;width:{{#expr:{{{5|175}}}*2}}px;height:{{#expr:{{{5|175}}}*2}}px;overflow: hidden;display:inline-block;"><div style="-webkit-clip-path: circle({{{5|175}}}px at {{{3}}}px {{{4}}}px); clip-path: circle({{{5|175}}}px at {{{3}}}px {{{4}}}px); transform: translate({{#expr: {{{5|175}}}-{{{3}}} }}px,{{#expr: {{{5|175}}}-{{{4}}} }}px);">[[File:MAP{{#switch: {{lc:{{{2|}}} }}
 
|felucca=0
 
|felucca=0

Revision as of 15:38, 4 September 2016


{{#ifeq: map|map|Template loop detected: Template:UO Image


Maps

{{UO_Image|map|facet|x|y|w|b}}
Where:
facet = felucca, trammel, ilshenar, tokuno, ter mur, or eodon
x and y = coords of the center of the circle
w = the radius of the circle to draw (in pixels)
b = optional, set to 'yes' to also show the coordinates of the center of the circle

Examples:
Vesper {{UO_Image|map|felucca|2926|842|215}}
Kotl City {{UO_Image|map|eodon|577|2371|153}}
Sea Market {{UO_Image|map|trammel|4550|2355|75|yes}}

Result:


{{#ifeq: map|map|

{{#ifeq: map|map|

{{#ifeq: map|map|

Shard Shields

{{UO_Image|shard|name|size}}
Where:
name = the name of the shard
link = optional, the name of the page you want linked to from the image.
size = optional, size in pixels.  By default it is 60px.

Examples:
Baekdu: {{UO_Image|shard|Baekdu}}
Chesapeake: {{UO_Image|shard|Chesapeake}}
Formosa: {{UO_Image|shard|Formosa}}
Yamato: {{UO_Image|shard|Yamato|60}}

Result:


{{#ifeq: shard|map|UO-image-shard-Baekdu.png

{{#ifeq: shard|map|UO-image-shard-Chesapeake.png

{{#ifeq: shard|map|UO-image-shard-Formosa.png

{{#ifeq: shard|map|UO-image-shard-Yamato.png


Icons

{{UO_Image|icon|name|size}}
Where:
name = the name of the icon
size = optional, size in pixels.  By default it is 40px.
 

Valid icons:

{{#ifeq: icon|map|UO-image-icon-Caution.png Caution