Actions

Template

Difference between revisions of "Bobscreen"

From Sega Retro

(copied from bobscreenTest)
Line 1: Line 1:
<includeonly><div style="display:none">
+
<includeonly>{{#vardefine:hscale|{{#expr:{{#switch:{{#mediadimensions:{{{1}}}}}
{{#vardefine:imagewidth|{{#mediawidth:{{{1}}}}}}}
+
| 256 × 224 = 1.25 <!--Mega Drive-->
{{#vardefine:imageheight|{{#mediaheight:{{{1}}}}}}}
+
| 160 × 144 = 1.2 <!--Game Gear-->
{{#vardefine:xratio|{{#if:{{{forcewidescreen|}}}|16|4}}}}
+
| 352 × 224 = (320/352) <!--Saturn-->
{{#vardefine:yratio|{{#if:{{{forcewidescreen|}}}|9|3}}}}
+
| 704 × 448 = (640/704) <!--Saturn-->
{{#if:{{{forcewidescreen|}}}||{{
+
| 352 × 240 = (320/352) <!--Saturn PAL-->
#ifeq: {{#mediadimensions:{{{1}}}}} | 320 × 224 |{{#vardefine:xratio|10}}{{#vardefine:yratio|7}}|}}{{
+
| 704 × 480 = (640/704) <!--Saturn PAL-->
#ifeq: {{#mediadimensions:{{{1}}}}} | 256 × 224 |{{#vardefine:xratio|10}}{{#vardefine:yratio|7}}|}}{{
+
| 224 × 224 = (320/224) <!--Bank Panic-->
#ifeq: {{#mediadimensions:{{{1}}}}} | 248 × 192 |{{#vardefine:xratio|31}}{{#vardefine:yratio|24}}|}}{{
+
| 240 × 224 = (320/240) <!--Super Locomotive-->
#ifeq: {{#mediadimensions:{{{1}}}}} | 256 × 384 |{{#vardefine:xratio|3}}{{#vardefine:yratio|2}}|}}
+
| 288 × 224 = 1 <!--Flashgal, appears to use square pixels.-->
}}
+
| 384 × 496 = (372/384) <!--Vertical arcade (e.g. Gain Ground)-->
{{#ifeq:{{#mediadimensions:{{{1}}}}} | 240 × 160 |{{#vardefine:xratio|3}}{{#vardefine:yratio|2}}|}}
+
| 1
{{#ifeq:{{#mediadimensions:{{{1}}}}} | 960 × 544 |{{#vardefine:xratio|16}}{{#vardefine:yratio|9}}|}}
+
}}}}}}{{#vardefine:vscale|{{#expr:{{#switch:{{#mediadimensions:{{{1}}}}}
{{#ifeq:{{#mediadimensions:{{{1}}}}} | 1,280 × 720 |{{#vardefine:xratio|16}}{{#vardefine:yratio|9}}|}}
+
| 224 × 256 = 1.25 <!--Vertical arcade (e.g. Deep Scan)-->
{{#ifeq:{{#mediadimensions:{{{1}}}}} | 1,920 × 1080 |{{#vardefine:xratio|16}}{{#vardefine:yratio|9}}|}}
+
| 240 × 256 = 1.25 <!--Vertical arcade (e.g. Angel Kids)-->
 
+
| 208 × 256 = 1.08 <!--Vertical arcade (e.g. Bull Fighter)-->
<!-- vertical monitors -->
+
| 224 × 240 = (320/240) <!--Vertical arcade (e.g. Water Match)-->
{{#ifexpr:{{#mediawidth:{{{1}}}}} < {{#mediaheight:{{{1}}}}}|
+
| 512 × 448 = 0.8 <!--PlayStation 2-->
{{#vardefine:oldxratio|{{#var:xratio}}}}
+
| 512 × 480 = (384/480) <!--Astron Belt-->
{{#vardefine:xratio|{{#var:yratio}}}}
+
| 224 × 288 = 1 <!--Pengo, square pixels.-->
{{#vardefine:yratio|{{#var:oldxratio}}}}
+
| 496 × 384 = (372/384) <!--Model 1/2 (e.g. Virtua Fighter)-->
|}}
+
| {{#ifeq:{{{forcewidescreen}}}|yes|0.8|1}}
{{#vardefine:calculatedheight|{{#var:imageheight}}}}
+
}}}}}}{{#vardefine:is3d|{{#switch:{{#mediadimensions:{{{1}}}}}
{{#vardefine:calculatedwidth|{{#expr:({{#var:calculatedheight}}/{{#var:yratio}})*{{#var:xratio}}}}}}
+
| 512 × 192 = yes <!--Master System-->
 
+
| 496 × 192 = yes <!--Master System (cropped)-->
 
+
| no
{{#if:{{{width|}}}|{{#vardefine:calculatedwidth|{{{width}}}}}{{#vardefine:calculatedheight|{{#expr:({{#var:calculatedwidth}}/{{#var:xratio}})*{{#var:yratio}}}}}}|}}
+
}}}}{{#if:{{{width|}}} | {{#vardefine:bswidth|{{{width|}}}}} {{#vardefine:bsheight|{{#expr:{{w2h|{{{1}}}|{{#expr:{{{width|}}}/{{#var:hscale}}}}}}*{{#var:vscale}}}}}}
{{#if:{{{height|}}}|{{#vardefine:calculatedheight|{{{height}}}}}{{#vardefine:calculatedwidth|{{#expr:({{#var:calculatedheight}}/{{#var:yratio}})*{{#var:xratio}}}}}}|}}
+
}}{{#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:xscale|{{#expr:{{#var:calculatedwidth}}/{{#var:imagewidth}}}}}}
+
| {{#vardefine:bswidth|{{#expr:{{#mediawidth:{{{1}}}}}*{{#var:hscale}}}}}}{{#vardefine:bsheight|{{#expr:{{#mediaheight:{{{1}}}}}*{{#var:vscale}}}}}}
{{#vardefine:yscale|{{#expr:{{#var:calculatedheight}}/{{#var:imageheight}}}}}}
+
| {{#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:hmargin|{{#expr:({{#var:calculatedwidth}}-{{#var:imagewidth}})/2}}}}
 
{{#vardefine:vmargin|{{#expr:({{#var:calculatedheight}}-{{#var:imageheight}})/2}}}}
 
</div><div class="bobscreen" style="margin-bottom: {{#var:vmargin}}px; margin-top: {{#var:vmargin}}px; margin-left: {{#var:hmargin}}px; margin-right: {{#var:hmargin}}px; display:inline-block; text-align:center;"><div style="transform:scale({{#var:xscale}},{{#var:yscale}}); transform-origin:50%;">[[File:{{{1}}}]]</div></div></includeonly><noinclude>
 
  
 
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.
  
==Height==
+
==Examples==
In addition, this template corrects heights:
+
{|class="prettytable"
[[File:WinterHeat title.png]] -> {{bobscreen|WinterHeat title.png}}
+
! Code || Raw image || Output
 
+
|-
 
+
| <nowiki>{{bobscreen|Gain Ground Title.png|height=320}}</nowiki>
[[File:Clockwork Knight Title.png]] -> {{bobscreen|Clockwork Knight Title.png}}
+
| [[File:Gain Ground Title.png]]
 
+
| {{bobscreen|Gain Ground Title.png|height=320}}
 
+
|-
[[File:NiGHTS title.png]] -> {{bobscreen|NiGHTS title.png}}
+
| <nowiki>{{bobscreen|Virtua Fighter Title.png}}</nowiki>
 
+
| [[File:Virtua Fighter Title.png]]
 
+
| {{bobscreen|Virtua Fighter Title.png}}
[[File:NiGHTS title.png]] -> {{bobscreen|NiGHTS title.png|width=320}}
+
|-
 
+
| <nowiki>{{bobscreen|AlteredBeast PS2 title.png}}</nowiki>
==Anamorphic widescreen==
+
| [[File:AlteredBeast PS2 title.png]]
widescreen [[File:VirtuaFighter 32X Widescreen2.png]] -> {{bobscreen|VirtuaFighter 32X Widescreen2.png|forcewidescreen=yes}}
+
| {{bobscreen|AlteredBeast PS2 title.png}}
 
+
|-
 
+
| <nowiki>{{bobscreen|BladeEagle title.png}}</nowiki>
widescreen [[File:VirtuaFighter 32X Widescreen2 PAL.png]] -> {{bobscreen|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes}}
+
| [[File:BladeEagle title.png]]
 
+
| {{bobscreen|BladeEagle title.png}}
 
+
|-
widescreen w200 [[File:VirtuaFighter 32X Widescreen2 PAL.png]] -> {{bobscreen|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes|width=200}}
+
| <nowiki>{{bobscreen|OutRun3D title.png}}</nowiki>
 
+
| [[File:OutRun3D title.png]]
 
+
| {{bobscreen|OutRun3D title.png}}
widescreen h200 [[File:VirtuaFighter 32X Widescreen2 PAL.png]] -> {{bobscreen|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes|height=200}}
+
|-
 
+
| <nowiki>{{bobscreen|Scd titlescreen.png}}</nowiki>
==Vertical monitors==
+
| [[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>
==Master System==
+
| [[File:Clockwork Knight Title.png]]
[[File:Alex Kidd in Miracle World Title.png]] -> {{bobscreen|Alex Kidd in Miracle World Title.png}}
+
| {{bobscreen|Clockwork Knight Title.png}}
 
+
|-
==Widescreen==
+
| <nowiki>{{bobscreen|NiGHTS title.png}}</nowiki>
{{bobscreen|Vanquish title screen.png|width=320}}
+
| [[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

MagicalPuzzlePopils title.png

This is how the game appears on an actual Sega Game Gear. The original image taken from an emulator is below:

MagicalPuzzlePopils title.png

Options

{{bobscreen|MagicalPuzzlePopils title.png|width=120}}

returns

MagicalPuzzlePopils title.png

"width" also takes into account the adjusted aspect ratio, so the image appears 120 pixels wide even if the source image is not.

Examples

Code Raw image Output
{{bobscreen|Gain Ground Title.png|height=320}} Gain Ground Title.png
Gain Ground Title.png
{{bobscreen|Virtua Fighter Title.png}} Virtua Fighter Title.png
Virtua Fighter Title.png
{{bobscreen|AlteredBeast PS2 title.png}} AlteredBeast PS2 title.png
AlteredBeast PS2 title.png
{{bobscreen|BladeEagle title.png}} BladeEagle title.png
BladeEagle title.png
{{bobscreen|OutRun3D title.png}} OutRun3D title.png
OutRun3D title.png
{{bobscreen|Scd titlescreen.png}} Scd titlescreen.png
Scd titlescreen.png
{{bobscreen|WinterHeat title.png}} WinterHeat title.png
WinterHeat title.png
{{bobscreen|Clockwork Knight Title.png}} ClockworkKnightUSPAL Title.png
ClockworkKnightUSPAL Title.png
{{bobscreen|NiGHTS title.png}} NiGHTS title.png
NiGHTS title.png
{{bobscreen|VirtuaFighter 32X Widescreen2.png|forcewidescreen=yes}} VirtuaFighter 32X Widescreen2.png
VirtuaFighter 32X Widescreen2.png
{{bobscreen|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes}} VirtuaFighter 32X Widescreen2 PAL.png
VirtuaFighter 32X Widescreen2 PAL.png
{{bobscreen|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes|width=200}} VirtuaFighter 32X Widescreen2 PAL.png
VirtuaFighter 32X Widescreen2 PAL.png
{{bobscreen|VirtuaFighter 32X Widescreen2 PAL.png|forcewidescreen=yes|height=240}} VirtuaFighter 32X Widescreen2 PAL.png
VirtuaFighter 32X Widescreen2 PAL.png
{{bobscreen|Deep Scan.png}} Deep Scan.png
Deep Scan.png
{{bobscreen|Deep Scan.png|height=320}} Deep Scan.png
Deep Scan.png
{{bobscreen|Deep Scan.png|width=200}} Deep Scan.png
Deep Scan.png
{{bobscreen|Alex Kidd in Miracle World Title.png}} Alex Kidd in Miracle World Title.png
Alex Kidd in Miracle World Title.png
{{bobscreen|Outrun2spsdxscreen.png|width=320}} Outrun2spsdxscreen.png
Outrun2spsdxscreen.png