Template:Coordinate to Pixel: Difference between revisions
Jump to navigation
Jump to search
imported>Tlosk's Bot New page: <includeonly> {{#switch: {{uc:{{{Direction}}}}} | N = {{#expr: {{{Scale|128}}} - {{{Offset|0}}} - {{{Value|0}}} / 102.8 * 128 round 0}} | S = {{#expr: {{{Scale|128}}} - {{{Offset|0}}} + ... |
imported>Tlosk's Bot No edit summary |
||
| Line 1: | Line 1: | ||
{{#vardefine:pixel|{{#switch: {{uc:{{{Direction}}}}} | |||
{{#switch: {{uc:{{{Direction}}}}} | |||
| N = {{#expr: {{{Scale|128}}} - {{{Offset|0}}} - {{{Value|0}}} / 102.8 * 128 round 0}} | | N = {{#expr: {{{Scale|128}}} - {{{Offset|0}}} - {{{Value|0}}} / 102.8 * 128 round 0}} | ||
| S = {{#expr: {{{Scale|128}}} - {{{Offset|0}}} + {{{Value|0}}} / 102.8 * 128 round 0}} | | S = {{#expr: {{{Scale|128}}} - {{{Offset|0}}} + {{{Value|0}}} / 102.8 * 128 round 0}} | ||
| Line 6: | Line 5: | ||
| W = {{#expr: {{{Scale|128}}} - {{{Offset|0}}} - {{{Value|0}}} / 102.8 * 128 round 0}} | | W = {{#expr: {{{Scale|128}}} - {{{Offset|0}}} - {{{Value|0}}} / 102.8 * 128 round 0}} | ||
| 0 | | 0 | ||
}} | }}}} | ||
<includeonly> | |||
{{#var:pixel}} | |||
</includeonly> | </includeonly> | ||
<noinclude> | <noinclude> | ||
Revision as of 15:10, 20 January 2009
{{#vardefine:pixel|0}}
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:
{{#vardefine:pixel|0}}
{{#var:pixel}}