Difference between revisions of "BobscreenTest"
From Sega Retro
(fixed some errors) |
|||
Line 6: | Line 6: | ||
| 352 × 240 = 0.9 <!--Saturn PAL--> | | 352 × 240 = 0.9 <!--Saturn PAL--> | ||
| 704 × 480 = 0.9 <!--Saturn PAL--> | | 704 × 480 = 0.9 <!--Saturn PAL--> | ||
− | |||
| 1 | | 1 | ||
}}}}{{#vardefine:vscale|{{#switch:{{#mediadimensions:{{{1}}}}} | }}}}{{#vardefine:vscale|{{#switch:{{#mediadimensions:{{{1}}}}} | ||
| 224 × 256 = 1.25 <!--Vertical arcade (e.g. Deep Scan)--> | | 224 × 256 = 1.25 <!--Vertical arcade (e.g. Deep Scan)--> | ||
+ | | 240 × 256 = 1.25 <!--Vertical arcade (e.g. Angel Kids)--> | ||
+ | | 512 × 448 = 0.8 <!--PlayStation 2--> | ||
| {{#ifeq:{{{forcewidescreen}}}|yes|0.8|1}} | | {{#ifeq:{{{forcewidescreen}}}|yes|0.8|1}} | ||
}}}}{{#vardefine:is3d|{{#switch:{{#mediadimensions:{{{1}}}}} | }}}}{{#vardefine:is3d|{{#switch:{{#mediadimensions:{{{1}}}}} | ||
Line 19: | Line 20: | ||
}}{{#if:{{{width|}}}{{{height|}}} || {{#ifexpr:({{#mediawidth:{{{1}}}}}*{{#var:hscale}})<{{#ifeq:{{#var:is3d}}|yes|641|321}} | }}{{#if:{{{width|}}}{{{height|}}} || {{#ifexpr:({{#mediawidth:{{{1}}}}}*{{#var:hscale}})<{{#ifeq:{{#var:is3d}}|yes|641|321}} | ||
| {{#vardefine:bswidth|{{#expr:{{#mediawidth:{{{1}}}}}*{{#var:hscale}}}}}}{{#vardefine:bsheight|{{#expr:{{#mediaheight:{{{1}}}}}*{{#var:vscale}}}}}} | | {{#vardefine:bswidth|{{#expr:{{#mediawidth:{{{1}}}}}*{{#var:hscale}}}}}}{{#vardefine:bsheight|{{#expr:{{#mediaheight:{{{1}}}}}*{{#var:vscale}}}}}} | ||
− | | {{#vardefine:bswidth|320}}{{#vardefine:bsheight|{{w2h|{{{1}}}|{{#expr:320/{{#var:hscale}}}}}}}}}} | + | | {{#vardefine:bswidth|320}}{{#vardefine:bsheight|{{#expr:{{w2h|{{{1}}}|{{#expr:320/{{#var:hscale}}}}}}*{{#var:vscale}}}} }}}} |
}}{{#vardefine:rawwidth|{{#expr:trunc({{#var:bswidth}}/{{#var:hscale}})}}}}{{#ifeq:{{#var:is3d}}|yes|{{#vardefine:bswidth|{{#expr:{{#var:bswidth}}/2}}}}}} | }}{{#vardefine:rawwidth|{{#expr:trunc({{#var:bswidth}}/{{#var:hscale}})}}}}{{#ifeq:{{#var:is3d}}|yes|{{#vardefine:bswidth|{{#expr:{{#var:bswidth}}/2}}}}}} | ||
{{#var:bswidth}},{{#var:bsheight}} | {{#var:bswidth}},{{#var:bsheight}} |
Revision as of 16:51, 13 July 2018
This template sets the maximum width of a screenshot to 320 pixels, and corrects its aspect ratio.
Usage
{{bobscreen|MagicalPuzzlePopils title.png}}
returns
192,144
This is how the game appears on an actual Sega Game Gear. The original image taken from an emulator is below:
Options
{{bobscreenTest|MagicalPuzzlePopils title.png|width=120}}
returns
120,90
"width" also takes into account the adjusted aspect ratio, so the image appears 120 pixels wide even if the source image is not.