Difference between revisions of "Bobscreen"
From Sonic Retro
BSonirachi (talk | contribs) (updated to Sega Retro's version of the template) |
BSonirachi (talk | contribs) (nevermind, this broke OmniThumbs) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly>{{# | + | <includeonly>{{#vardefine:hscale|{{#expr:{{#switch:{{#mediadimensions:{{{1}}}}} |
− | + | | 256 × 224 = 1.25 <!--Mega Drive--> | |
− | + | | 160 × 144 = 1.2 <!--Game Gear--> | |
− | | | + | | 352 × 224 = (320/352) <!--Saturn--> |
− | | | + | | 704 × 448 = (640/704) <!--Saturn--> |
− | | | + | | 352 × 240 = (320/352) <!--Saturn PAL--> |
− | | | + | | 704 × 480 = (640/704) <!--Saturn PAL--> |
− | | | + | | 224 × 224 = (320/224) <!--Bank Panic--> |
− | | | + | | 240 × 224 = (320/240) <!--Super Locomotive--> |
− | | | + | | 256 × 240 = 1.25 <!--X68000--> |
− | + | | 288 × 224 = 1 <!--Flashgal, appears to use square pixels.--> | |
− | + | | 384 × 496 = (372/384) <!--Vertical arcade (e.g. Gain Ground)--> | |
− | | | + | | 1 |
− | | | + | }}}}}}{{#vardefine:vscale|{{#expr:{{#switch:{{#mediadimensions:{{{1}}}}} |
− | | | + | | 224 × 256 = 1.25 <!--Vertical arcade (e.g. Deep Scan)--> |
− | | | + | | 240 × 256 = 1.25 <!--Vertical arcade (e.g. Angel Kids)--> |
− | | | + | | 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 × 480 = (384/480) <!--Astron Belt--> |
− | + | | 224 × 288 = 1 <!--Pengo, square pixels.--> | |
− | | | + | | 496 × 384 = (372/384) <!--Model 1/2 (e.g. Virtua Fighter)--> |
− | | | + | | {{#ifeq:{{{forcewidescreen}}}|yes|0.8|1}} |
− | | | + | }}}}}}{{#vardefine:is3d|{{#switch:{{#mediadimensions:{{{1}}}}} |
− | | | + | | 512 × 192 = yes <!--Master System--> |
− | + | | 496 × 192 = yes <!--Master System (cropped)--> | |
− | | | + | | no |
− | | | + | }}}}{{#if:{{{width|}}} | {{#vardefine:bswidth|{{{width|}}}}} {{#vardefine:bsheight|{{#expr:{{w2h|{{{1}}}|{{#expr:{{{width|}}}/{{#var:hscale}}}}}}*{{#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}} |
− | | | + | | {{#vardefine:bswidth|{{#expr:{{#mediawidth:{{{1}}}}}*{{#var:hscale}}}}}}{{#vardefine:bsheight|{{#expr:{{#mediaheight:{{{1}}}}}*{{#var:vscale}}}}}} |
− | | | + | | {{#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}}}}}}<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%; width:{{#var:rawwidth}}px !important;">[[File:{{{1}}}|{{#var:rawwidth}}px{{#if:{{{link|}}}|{{!}}link={{{link|}}}|}}]]</div></div></includeonly><noinclude> | |
− | | | + | This template sets the maximum width of a screenshot to 320 pixels, and corrects its aspect ratio. |
− | | | ||
− | | | ||
− | | | ||
− | |||
− | | | ||
− | | | ||
− | | | ||
− | | | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | | | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Usage== | ==Usage== | ||
<tt><nowiki>{{bobscreen|Sonic Chaos title GG.png}}</nowiki></tt> | <tt><nowiki>{{bobscreen|Sonic Chaos title GG.png}}</nowiki></tt> |
Latest revision as of 12:53, 5 January 2023
This template sets the maximum width of a screenshot to 320 pixels, and corrects its aspect ratio.
Usage
{{bobscreen|Sonic Chaos title GG.png}}
returns
This is how the game appears on an actual Sega Game Gear. The original image taken from an emulator is below:
Options
{{bobscreen|Sonic Chaos title GG.png|width=120}}
returns
"width" also takes into account the adjusted aspect ratio, so the image appears 120 pixels wide even if the source image is not.
{{bobscreen|Sonic Chaos title GG.png|link=Sonic Chaos}}
returns
{{bobscreen|SonicColours Wii EU Title.png|forcewidescreen=yes}}
returns
"forcewidescreen" is useful for screenshots that rely on anamorphic widescreen to display a 4:3 image as a 16:9 image.