Actions

Template

Difference between revisions of "Bobscreen"

From Sonic Retro

m (Protected "Template:Bobscreen": High traffic page: if it's protected on Sega Retro then it should be protected here too ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(updated to Sega Retro's version of the template)
Line 1: Line 1:
<includeonly>{{#vardefine:hscale|{{#expr:{{#switch:{{#mediadimensions:{{{1}}}}}
+
<includeonly>{{#if:{{{noresize|}}}|[[File:{{{1|}}}{{#if:{{{width|}}}{{{height|}}}|{{!}}}}{{#if:{{{width|}}}|{{{width|}}}}}{{#if:{{{height|}}}|x{{{height|}}}}}{{#if:{{{width|}}}{{{height|}}}|px}}]]|{{let|imagedim={{#replace:{{#mediadimensions:{{{1|}}}}}|,|}}}}{{let|imagew={{#explode:{{#var:imagedim}}|×|0}}|imageh={{#explode:{{#var:imagedim}}|1}}}}
| 256 × 224 = 1.25 <!--Mega Drive-->
+
{{let|bsparams={{#switch:{{#var:imagedim}}
| 160 × 144 = 1.2 <!--Game Gear-->
+
<!--thumbnail width, display width, display height, crop (1=no, 2=show left half only)-->
| 352 × 224 = (320/352) <!--Saturn-->
+
| 256 × 192 = 256,{{#switch:{{{smsgg|}}}|yes=192,144|256,192}},1 <!--Master System-->
| 704 × 448 = (640/704) <!--Saturn-->
+
| 248 × 192 = 248,248,192,1 <!--Master System (cropped)-->
| 352 × 240 = (320/352) <!--Saturn PAL-->
+
| 512 × 192 = 512,512,192,2 <!--Master System 3D-->
| 704 × 480 = (640/704) <!--Saturn PAL-->
+
| 496 × 192 = 496,496,192,2 <!--Master System 3D (cropped)-->
| 224 × 224 = (320/224) <!--Bank Panic-->
+
| 256 × 224 = 256,320,224,1 <!--Mega Drive-->
| 240 × 224 = (320/240) <!--Super Locomotive-->
+
| 256 × 240 = 256,320,240,1 <!--Mega Drive PAL; X68000-->
| 256 × 240 = 1.25 <!--X68000-->
+
| 640 × 480
| 288 × 224 = 1 <!--Flashgal, appears to use square pixels.-->
+
| 320 × 240
| 384 × 496 = (372/384) <!--Vertical arcade (e.g. Gain Ground)-->
+
| 320 × 480 = 320,320,240,1 <!--Mega Drive PAL interlaced-->
| 1
+
| 160 × 144 = 160,192,144,1 <!--Game Gear-->
}}}}}}{{#vardefine:vscale|{{#expr:{{#switch:{{#mediadimensions:{{{1}}}}}
+
| 352 × 224
| 224 × 256 = 1.25 <!--Vertical arcade (e.g. Deep Scan)-->
+
| 704 × 448 = 352,320,224,1 <!--Saturn-->
| 240 × 256 = 1.25 <!--Vertical arcade (e.g. Angel Kids)-->
+
| 352 × 240
| 208 × 256 = 1.08 <!--Vertical arcade (e.g. Bull Fighter)-->
+
| 352 × 256
| 224 × 240 = (320/240) <!--Vertical arcade (e.g. Water Match)-->
+
| 704 × 480 = 352,320,240,1 <!--Saturn PAL-->
| 512 × 448 = 0.8 <!--PlayStation 2-->
+
| 224 × 224 = 224,320,224,1 <!--Bank Panic-->
| 512 × 480 = (384/480) <!--Astron Belt-->
+
| 240 × 224 = 240,320,224,1 <!--Super Locomotive-->
| 224 × 288 = 1 <!--Pengo, square pixels.-->
+
| 288 × 224 = 288,288,224,1 <!--Flashgal, appears to use square pixels.-->
| 496 × 384 = (372/384) <!--Model 1/2 (e.g. Virtua Fighter)-->
+
| 384 × 496 = 384,224,320,1 <!--Vertical arcade (e.g. Gain Ground)-->
| {{#ifeq:{{{forcewidescreen}}}|yes|0.8|1}}
+
| 384 × 224 = 384,320,224,1 <!-- Capcom arcade -->
}}}}}}{{#vardefine:is3d|{{#switch:{{#mediadimensions:{{{1}}}}}
+
| 416 × 224 = 416,320,224,1 <!-- Burning Rival -->
| 512 × 192 = yes <!--Master System-->
+
| 224 × 320 = 224,224,320,1 <!--Vertical arcade (e.g. Time Scanner)-->
| 496 × 192 = yes <!--Master System (cropped)-->
+
| 224 × 256 = 224,224,320,1 <!--Vertical arcade (e.g. Deep Scan)-->
| no
+
| 240 × 256 = 240,240,320,1 <!--Vertical arcade (e.g. Angel Kids)-->
}}}}{{#if:{{{width|}}} | {{#vardefine:bswidth|{{{width|}}}}} {{#vardefine:bsheight|{{#expr:{{w2h|{{{1}}}|{{#expr:{{{width|}}}/{{#var:hscale}}}}}}*{{#var:vscale}}}}}}
+
| 208 × 256 = 208,208,277,1 <!--Vertical arcade (e.g. Bull Fighter)-->
}}{{#if:{{{height|}}} | {{#vardefine:bsheight|{{{height|}}}}} {{#vardefine:bswidth|{{#expr:({{h2w|{{{1}}}|{{#expr:{{{height|}}}}}/{{#var:vscale}}}})*{{#var:hscale}}}}}}
+
| 224 × 240 = 224,224,320,1 <!--Vertical arcade (e.g. Water Match)-->
}}{{#if:{{{width|}}}{{{height|}}} || {{#ifexpr:({{#mediawidth:{{{1}}}}}*{{#var:hscale}})<{{#ifeq:{{#var:is3d}}|yes|641|321}}
+
| 480 × 640 = 240,240,320,1 <!--Vertical arcade (e.g. Ikaruga)-->
| {{#vardefine:bswidth|{{#expr:{{#mediawidth:{{{1}}}}}*{{#var:hscale}}}}}}{{#vardefine:bsheight|{{#expr:{{#mediaheight:{{{1}}}}}*{{#var:vscale}}}}}}
+
| 512 × 480 = 320,320,240,1 <!--Astron Belt-->
| {{#vardefine:bswidth|320}}{{#vardefine:bsheight|{{#expr:{{w2h|{{{1}}}|{{#expr:320/{{#var:hscale}}}}}}*{{#var:vscale}}}} }}}}
+
| 224 × 288 = 224,224,288,1 <!--Pengo, square pixels.-->
}}{{#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>
+
| 496 × 384 = 320,320,240,1 <!--Model 1/2 (e.g. Virtua Fighter)-->
 +
| 400 × 254 = 400,320,240,1 <!-- Midway arcade -->
 +
| 248 × 224 = 248,320,224,1 <!-- PC Engine -->
 +
| 512 × 239 = 512,320,239,1 <!--SNES-->
 +
| 512 × 478
 +
| 256 × 239 = 256,320,239,1 <!--NES/SNES-->
 +
| 512 × 224 = 512,320,224,1 <!--SNES-->
 +
| 512 × 448 = 320,320,224,1 <!--SNES; PlayStation 2-->
 +
| 240 × 160 = 240,240,160,1 <!--GBA-->
 +
| 256 × 384 = 256,256,384,1 <!--Nintendo DS-->
 +
| 400 × 480 = 320,320,384,1 <!--Nintendo 3DS-->
 +
<!--| 800 × 480 = 640,640,384,2 Nintendo 3DS 3D-->
 +
| 480 × 272 = 320,320,181,1 <!--PlayStation Portable-->
 +
| 960 × 544 = 320,320,181,1 <!--PlayStation Vita-->
 +
| 800 × 480 = 320,320,192,1 <!--Android-->
 +
| 480 × 800 = 240,240,400,1 <!--Android; vertical-->
 +
| 1792 × 828 = 320,320,147.857,1 <!--iOS -->
 +
| 160 × 152 = 160,160,152,1 <!--NGPC-->
 +
| 160 × 102 = 160,160,102,1 <!-- Lynx -->
 +
| 256 × 212 = 256,283,212,1 <!-- MSX2 -->
 +
| 320 × 256 = 320,320,240,1 <!-- Amiga -->
 +
| 304 × 224 = 304,320,224,1 <!-- Amiga -->
 +
| 352 × 200 = 352,320,240,1 <!-- Amiga -->
 +
| 320 × 199
 +
| 320 × 208
 +
| 320 × 192 = 320,320,240,1 <!-- Amiga -->
 +
| 312 × 192 = 312,312,234,1 <!-- Amiga -->
 +
| 256 × 232 = 256,309,232,1 <!--X68000-->
 +
| 320 × 200
 +
| 640 × 400
 +
| 640 × 350 = 320,320,240,1 <!--IBM PC-->
 +
| 640 × 300
 +
| 720 × 348 = 320,320,240,1 <!--IBM PC (Hercules)-->
 +
| 336 × 240 = 336,320,240,1 <!-- Atari 8-bit -->
 +
| 352 × 184 = 352,320,240,1 <!-- VIC-20 -->
 +
| 360 × 240 = 360,320,240,1 <!-- VIC-20 -->
 +
| 360 × 230 = 360,320,240,1 <!-- PC-6001 -->
 +
| 320 × 210
 +
| 320 × 214 = 320,320,240,1 <!-- Atari 2600 -->
 +
| 280 × 192 = 280,280,210,1 <!-- Apple II -->
 +
| 768 × 400 = 320,320,240,1 <!-- X68000 (Bonanza Bros.)-->
 +
| 200 × 160 = 200,200,160,1 <!-- Game.com -->
 +
| 176 × 208 = 176,176,208,1 <!-- N-Gage -->
 +
| 1280 × 720
 +
| 1920 × 1080
 +
| 2560 × 1440
 +
| 3840 × 2160 = 320,320,180,1 <!-- HD -->
 +
| 720 × 1280
 +
| 1080 × 1920
 +
| 1440 × 2560
 +
| 2160 × 3840 = 320,180,320,1 <!--HD; vertical-->
 +
| 320,320,224,1 <!--Default is Mega Drive NTSC-->
 +
}}}}{{let
 +
|thumbw={{#explode:{{#var:bsparams}}|,|0}}
 +
|bsw={{#explode:{{#var:bsparams}}|,|{{#switch:{{{keepwidth|}}}|yes=0|1}}}}
 +
|bsh={{#expr:{{#explode:{{#var:bsparams}}|,|2}}*{{#switch:{{{forcewidescreen|}}}|yes=0.8|1}}}}
 +
|bsc={{#explode:{{#var:bsparams}}|,|3}}
 +
}}{{getdim|actual={{#var:imagedim}}|w={{#var:thumbw}}|output=h|var=thumbh}}{{let
 +
|scale={{#if:{{{width|}}}|{{#expr:{{{width|}}}/({{#var:bsw}}/{{#var:bsc}})}}|{{#if:{{{height|}}}|{{#expr:{{{height|}}}/({{#var:bsh}}/{{#var:bsc}})}}|1}}}}
 +
|hscale={{#expr:{{#var:bsw}}/{{#var:thumbw}}}}
 +
|vscale={{#expr:{{#var:bsh}}/{{#var:thumbh}}}}
 +
}}
 +
<div style="overflow:hidden; display:inline-block;
 +
width:{{#expr:({{#var:bsw}}*{{#var:scale}})/{{#var:bsc}}}}px;
 +
height:{{#expr:{{#var:bsh}}*{{#var:scale}}}}px;
 +
">
 +
<div class="bobtransform" style="transform:scale({{#var:hscale}},{{#var:vscale}}); transform-origin:0% 0%; !important;">
 +
<div style="width:{{#expr:{{#var:thumbw}}*{{#var:scale}}}}px; height:{{#expr:{{#var:thumbh}}*{{#var:scale}}}}px;">
 +
[[File:{{{1|}}}|{{#expr:trunc({{#var:thumbw}}*{{#var:scale}})}}px|link={{{link|File:{{{1|}}}}}}]]
 +
</div>
 +
</div>
 +
</div>}}</includeonly><noinclude>
 
==Usage==
 
==Usage==
 
<tt><nowiki>{{bobscreen|Sonic Chaos title GG.png}}</nowiki></tt>
 
<tt><nowiki>{{bobscreen|Sonic Chaos title GG.png}}</nowiki></tt>
Line 37: Line 108:
 
returns
 
returns
 
{{bobscreen|Sonic Chaos title GG.png}}
 
{{bobscreen|Sonic Chaos title GG.png}}
{{bobscreen|Sonic Chaos title GG.png|link=Sonic Triple Trouble}}
+
This is how the game appears on an actual [[Sega Game Gear]]. The original image taken from an emulator is below:
 +
 
 +
[[File:Sonic Chaos title GG.png]]
 +
 
 +
===Options===
 +
<tt><nowiki>{{bobscreen|Sonic Chaos title GG.png|width=120}}</nowiki></tt>
 +
 
 +
returns
 +
{{bobscreen|Sonic Chaos title GG.png|width=120}}
 +
"width" also takes into account the adjusted aspect ratio, so the image appears 120 pixels wide even if the source image is not.
 +
 
 +
<tt><nowiki>{{bobscreen|Sonic Chaos title GG.png|link=Sonic Chaos}}</nowiki></tt>
 +
 
 +
returns
 +
{{bobscreen|Sonic Chaos title GG.png|link=Sonic Chaos}}
 +
 
 +
<tt><nowiki>{{bobscreen|SonicColours Wii EU Title.png|forcewidescreen=yes}}</nowiki></tt>
 +
 
 +
returns
 +
{{bobscreen|SonicColours Wii EU Title.png|forcewidescreen=yes}}
 +
"forcewidescreen" is useful for screenshots that rely on [[sega:Anamorphic widescreen|anamorphic widescreen]] to display a 4:3 image as a 16:9 image.
  
 
[[Category:Breakout box templates]]</noinclude>
 
[[Category:Breakout box templates]]</noinclude>

Revision as of 12:45, 5 January 2023

Usage

{{bobscreen|Sonic Chaos title GG.png}}

returns

Sonic Chaos title GG.png

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

Sonic Chaos title GG.png

Options

{{bobscreen|Sonic Chaos title GG.png|width=120}}

returns

Sonic Chaos title GG.png

"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

Sonic Chaos title GG.png

{{bobscreen|SonicColours Wii EU Title.png|forcewidescreen=yes}}

returns

SonicColours Wii EU Title.png

"forcewidescreen" is useful for screenshots that rely on anamorphic widescreen to display a 4:3 image as a 16:9 image.