Difference between revisions of "BobscreenTest"
From Sega Retro
(current template isn't coping well with that one, new template is - nicely done) |
|||
Line 1: | Line 1: | ||
− | <includeonly>{{#vardefine:hscale|{{#switch:{{#mediadimensions:{{{1}}}}} | + | <includeonly>{{#vardefine:hscale|{{#expr:{{#switch:{{#mediadimensions:{{{1}}}}} |
| 256 × 224 = 1.25 <!--Mega Drive--> | | 256 × 224 = 1.25 <!--Mega Drive--> | ||
| 160 × 144 = 1.2 <!--Game Gear--> | | 160 × 144 = 1.2 <!--Game Gear--> | ||
− | | 352 × 224 = | + | | 352 × 224 = (320/352) <!--Saturn--> |
− | | 704 × 448 = | + | | 704 × 448 = (640/704) <!--Saturn--> |
− | | 352 × 240 = | + | | 352 × 240 = (320/352) <!--Saturn PAL--> |
− | | 704 × 480 = | + | | 704 × 480 = (640/704) <!--Saturn PAL--> |
− | | 224 × 224 = | + | | 224 × 224 = (320/224) <!--Bank Panic--> |
− | | 240 × 224 = | + | | 240 × 224 = (320/240) <!--Super Locomotive--> |
| 288 × 224 = 1 <!--Flashgal, appears to use square pixels.--> | | 288 × 224 = 1 <!--Flashgal, appears to use square pixels.--> | ||
+ | | 384 × 496 = (372/384) <!--Vertical arcade (e.g. Gain Ground)--> | ||
| 1 | | 1 | ||
− | }}}}{{#vardefine:vscale|{{#switch:{{#mediadimensions:{{{1}}}}} | + | }}}}}}{{#vardefine:vscale|{{#expr:{{#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)--> | | 240 × 256 = 1.25 <!--Vertical arcade (e.g. Angel Kids)--> | ||
| 208 × 256 = 1.08 <!--Vertical arcade (e.g. Bull Fighter)--> | | 208 × 256 = 1.08 <!--Vertical arcade (e.g. Bull Fighter)--> | ||
+ | | 224 × 240 = (320/240) <!--Vertical arcade (e.g. Water Match)--> | ||
| 512 × 448 = 0.8 <!--PlayStation 2--> | | 512 × 448 = 0.8 <!--PlayStation 2--> | ||
− | | 512 × 480 = | + | | 512 × 480 = (384/480) <!--Astron Belt--> |
| 224 × 288 = 1 <!--Pengo, square pixels.--> | | 224 × 288 = 1 <!--Pengo, square pixels.--> | ||
+ | | 496 × 384 = (372/384) <!--Model 1/2 (e.g. Virtua Fighter)--> | ||
| {{#ifeq:{{{forcewidescreen}}}|yes|0.8|1}} | | {{#ifeq:{{{forcewidescreen}}}|yes|0.8|1}} | ||
− | }}}}{{#vardefine:is3d|{{#switch:{{#mediadimensions:{{{1}}}}} | + | }}}}}}{{#vardefine:is3d|{{#switch:{{#mediadimensions:{{{1}}}}} |
| 512 × 192 = yes <!--Master System--> | | 512 × 192 = yes <!--Master System--> | ||
| 496 × 192 = yes <!--Master System (cropped)--> | | 496 × 192 = yes <!--Master System (cropped)--> | ||
| no | | no | ||
}}}}{{#if:{{{width|}}} | {{#vardefine:bswidth|{{{width|}}}}} {{#vardefine:bsheight|{{#expr:{{w2h|{{{1}}}|{{#expr:{{{width|}}}/{{#var:hscale}}}}}}*{{#var:vscale}}}}}} | }}}}{{#if:{{{width|}}} | {{#vardefine:bswidth|{{{width|}}}}} {{#vardefine:bsheight|{{#expr:{{w2h|{{{1}}}|{{#expr:{{{width|}}}/{{#var:hscale}}}}}}*{{#var:vscale}}}}}} | ||
− | }}{{#if:{{{height|}}} | {{#vardefine:bsheight|{{{height|}}}}} {{#vardefine:bswidth|{{h2w|{{{1}}}|{{#expr:{{{height|}}}}}/{{#var:vscale}}}}}} | + | }}{{#if:{{{height|}}} | {{#vardefine:bsheight|{{{height|}}}}} {{#vardefine:bswidth|{{#expr:({{h2w|{{{1}}}|{{#expr:{{{height|}}}}}/{{#var:vscale}}}})*{{#var:hscale}}}}}} |
}}{{#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}}}}}} | ||
Line 29: | Line 32: | ||
}}{{#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}} | ||
− | <div class="bobscreen" style="width:{{#var:bswidth}}px; height:{{#var:bsheight}}px | + | <div class="bobscreen" style="width:{{#var:bswidth}}px; height:{{#var:bsheight}}px; display:inline-block; text-align:center; overflow:hidden;"> |
− | <div style="transform:scale({{#var:hscale}},{{#var:vscale}}); transform-origin:0% 0% | + | <div style="transform:scale({{#var:hscale}},{{#var:vscale}}); transform-origin:0% 0%; width:{{#var:rawwidth}}px !important;"> |
[[File:{{{1}}}|{{#var:rawwidth}}px]] | [[File:{{{1}}}|{{#var:rawwidth}}px]] | ||
</div></div></includeonly><noinclude> | </div></div></includeonly><noinclude> | ||
Line 55: | Line 58: | ||
{|class="prettytable" | {|class="prettytable" | ||
! Code || Raw image || Output | ! Code || Raw image || Output | ||
+ | |- | ||
+ | | <nowiki>{{bobscreenTest|Gain Ground Title.png}}</nowiki> | ||
+ | | [[File:Gain Ground Title.png]] | ||
+ | | {{bobscreenTest|Gain Ground Title.png|height=320}} | ||
+ | |- | ||
+ | | <nowiki>{{bobscreenTest|Virtua Fighter Title.png}}</nowiki> | ||
+ | | [[File:Virtua Fighter Title.png]] | ||
+ | | {{bobscreenTest|Virtua Fighter Title.png}} | ||
|- | |- | ||
| <nowiki>{{bobscreenTest|AlteredBeast PS2 title.png}}</nowiki> | | <nowiki>{{bobscreenTest|AlteredBeast PS2 title.png}}</nowiki> |
Revision as of 15:43, 20 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.