Difference between revisions of "Bobscreen"
From Sega Retro
(copied from bobscreenTest) |
|||
Line 1: | Line 1: | ||
− | <includeonly> | + | <includeonly>{{#vardefine:hscale|{{#expr:{{#switch:{{#mediadimensions:{{{1}}}}} |
− | {{#vardefine: | + | | 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--> |
− | # | + | | 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}}}}} |
− | {{#vardefine: | + | | 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: | + | | {{#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]]</div></div></includeonly><noinclude> | |
− | {{# | ||
− | {{#vardefine: | ||
− | |||
This template sets the maximum width of a screenshot to 320 pixels, and corrects its aspect ratio. | This template sets the maximum width of a screenshot to 320 pixels, and corrects its aspect ratio. | ||
Line 53: | Line 50: | ||
"width" also takes into account the adjusted aspect ratio, so the image appears 120 pixels wide even if the source image is not. | "width" also takes into account the adjusted aspect ratio, so the image appears 120 pixels wide even if the source image is not. | ||
− | == | + | ==Examples== |
− | + | {|class="prettytable" | |
− | [[File: | + | ! Code || Raw image || Output |
− | + | |- | |
− | + | | <nowiki>{{bobscreen|Gain Ground Title.png|height=320}}</nowiki> | |
− | [[File: | + | | [[File:Gain Ground Title.png]] |
− | + | | {{bobscreen|Gain Ground Title.png|height=320}} | |
− | + | |- | |
− | [[File: | + | | <nowiki>{{bobscreen|Virtua Fighter Title.png}}</nowiki> |
− | + | | [[File:Virtua Fighter Title.png]] | |
− | + | | {{bobscreen|Virtua Fighter Title.png}} | |
− | [[File:NiGHTS title.png]] | + | |- |
− | + | | <nowiki>{{bobscreen|AlteredBeast PS2 title.png}}</nowiki> | |
− | = | + | | [[File:AlteredBeast PS2 title.png]] |
− | + | | {{bobscreen|AlteredBeast PS2 title.png}} | |
− | + | |- | |
− | + | | <nowiki>{{bobscreen|BladeEagle title.png}}</nowiki> | |
− | + | | [[File:BladeEagle title.png]] | |
− | + | | {{bobscreen|BladeEagle title.png}} | |
− | + | |- | |
− | + | | <nowiki>{{bobscreen|OutRun3D title.png}}</nowiki> | |
− | + | | [[File:OutRun3D title.png]] | |
− | + | | {{bobscreen|OutRun3D title.png}} | |
− | + | |- | |
− | + | | <nowiki>{{bobscreen|Scd titlescreen.png}}</nowiki> | |
− | + | | [[File:Scd titlescreen.png]] | |
− | + | | {{bobscreen|Scd titlescreen.png}} | |
− | {{bobscreen|Deep Scan.png}} | + | |- |
− | + | | <nowiki>{{bobscreen|WinterHeat title.png}}</nowiki> | |
− | {{bobscreen|Deep Scan.png|height=320}} | + | | [[File:WinterHeat title.png]] |
− | + | | {{bobscreen|WinterHeat title.png}} | |
− | {{bobscreen|Deep Scan.png|width=200}} | + | |- |
− | + | | <nowiki>{{bobscreen|Clockwork Knight Title.png}}</nowiki> | |
− | = | + | | [[File:Clockwork Knight Title.png]] |
− | [[File:Alex Kidd in Miracle World Title.png]] | + | | {{bobscreen|Clockwork Knight Title.png}} |
− | + | |- | |
− | = | + | | <nowiki>{{bobscreen|NiGHTS title.png}}</nowiki> |
− | {{bobscreen| | + | | [[File:NiGHTS title.png]] |
+ | | {{bobscreen|NiGHTS title.png}} | ||
+ | |- | ||
+ | | <nowiki>{{bobscreen|VirtuaFighter 32X Widescreen2.png|forcewidescreen=yes}}</nowiki> | ||
+ | | [[File:VirtuaFighter 32X Widescreen2.png]] | ||
+ | | {{bobscreen|VirtuaFighter 32X Widescreen2.png|forcewidescreen=yes}} | ||
+ | |- | ||
+ | | <nowiki>{{bobscreen|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes}}</nowiki> | ||
+ | | [[File:VirtuaFighter 32X Widescreen2 PAL.png]] | ||
+ | | {{bobscreen|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes}} | ||
+ | |- | ||
+ | | <nowiki>{{bobscreen|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes|width=200}}</nowiki> | ||
+ | | [[File:VirtuaFighter 32X Widescreen2 PAL.png]] | ||
+ | | {{bobscreen|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes|width=200}} | ||
+ | |- | ||
+ | | <nowiki>{{bobscreen|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes|height=240}}</nowiki> | ||
+ | | [[File:VirtuaFighter 32X Widescreen2 PAL.png]] | ||
+ | | {{bobscreen|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes|height=240}} | ||
+ | |- | ||
+ | | <nowiki>{{bobscreen|Deep Scan.png}}</nowiki> | ||
+ | | [[File:Deep Scan.png]] | ||
+ | | {{bobscreen|Deep Scan.png}} | ||
+ | |- | ||
+ | | <nowiki>{{bobscreen|Deep Scan.png|height=320}}</nowiki> | ||
+ | | [[File:Deep Scan.png]] | ||
+ | | {{bobscreen|Deep Scan.png|height=320}} | ||
+ | |- | ||
+ | | <nowiki>{{bobscreen|Deep Scan.png|width=200}}</nowiki> | ||
+ | | [[File:Deep Scan.png]] | ||
+ | | {{bobscreen|Deep Scan.png|width=200}} | ||
+ | |- | ||
+ | | <nowiki>{{bobscreen|Alex Kidd in Miracle World Title.png}}</nowiki> | ||
+ | | [[File:Alex Kidd in Miracle World Title.png]] | ||
+ | | {{bobscreen|Alex Kidd in Miracle World Title.png}} | ||
+ | |- | ||
+ | | <nowiki>{{bobscreen|Outrun2spsdxscreen.png|width=320}}</nowiki> | ||
+ | | [[File:Outrun2spsdxscreen.png|320px]] | ||
+ | | {{bobscreen|Outrun2spsdxscreen.png|width=320}} | ||
+ | |} | ||
[[Category:Breakout box templates]] | [[Category:Breakout box templates]] | ||
</noinclude> | </noinclude> |
Revision as of 15:53, 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
This is how the game appears on an actual Sega Game Gear. The original image taken from an emulator is below:
Options
{{bobscreen|MagicalPuzzlePopils title.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.