Template:Coordinate to Pixel: Difference between revisions
Jump to navigation
Jump to search
imported>Tlosk's Bot No edit summary |
imported>Tlosk's Bot No edit summary |
||
Line 1: | Line 1: | ||
<includeonly> | |||
{{#switch: {{uc:{{{Direction}}}}} | {{#switch: {{uc:{{{Direction}}}}} | ||
| N = {{#vardefine:vn|{{#expr: {{{Scale|128}}} - {{{Offset|0}}} - {{{Value|0}}} / 102.8 * {{{Scale|128}}} round 0}}}} | | N = {{#vardefine:vn|{{#expr: {{{Scale|128}}} - {{{Offset|0}}} - {{{Value|0}}} / 102.8 * {{{Scale|128}}} round 0}}}} | ||
Line 6: | Line 7: | ||
| 0 | | 0 | ||
}} | }} | ||
{{#switch: {{uc:{{{Direction}}}}} | {{#switch: {{uc:{{{Direction}}}}} | ||
| N = {{#var:vn}} | | N = {{#var:vn}} | ||
Line 14: | Line 15: | ||
| 0 | | 0 | ||
}} | }} | ||
{{#var:vn}} | |||
</includeonly> | </includeonly> | ||
<noinclude> | <noinclude> |
Revision as of 16:08, 20 January 2009
Syntax
{{Coordinate to Pixel | <Value> (0.0 to 102.8) | <Direction> (N E S W) | <Scale> (128, 256, 512, etc) | <Offset> (Half point image width rounded up, minus any border width) }}
For example:
{{Coordinate to Pixel|10.5|N|128|3}}
gives the result:
0
0 {{#var:vn}}
112
128
128