Difference between revisions of "Bobscreen"

From Sega Retro

m
Line 21: Line 21:
 
{{#vardefine:vmargin|{{#expr:(({{#var:screenheight}}*{{#var:yscale}})-{{#var:screenheight}})/2}}}}
 
{{#vardefine:vmargin|{{#expr:(({{#var:screenheight}}*{{#var:yscale}})-{{#var:screenheight}})/2}}}}
  
</div><div style="width:{{#var:visiblewidth}}px; display:inline-block; text-align:center;"><div style="transform:scalex({{#var:scale}}); {{#ifeq:{{#var:yscale}}|1||transform:scaley({{#var:yscale}}); margin-top:{{#var:vmargin}}px; margin-bottom:{{#var:vmargin}}px;}} transform-origin:50%">[[File:{{{1}}}|{{#var:screenwidth}}x384px]]</div></div></includeonly><noinclude>
+
</div><div class="bobscreen" style="width:{{#var:visiblewidth}}px; display:inline-block; text-align:center;"><div style="transform:scalex({{#var:scale}}); {{#ifeq:{{#var:yscale}}|1||transform:scaley({{#var:yscale}}); margin-top:{{#var:vmargin}}px; margin-bottom:{{#var:vmargin}}px;}} transform-origin:50%">[[File:{{{1}}}|{{#var:screenwidth}}x384px]]</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.
  

Revision as of 12:45, 18 February 2017

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.

Height

In addition, this template corrects heights:

WinterHeat title.png ->











WinterHeat title.png


ClockworkKnightUSPAL Title.png ->











ClockworkKnightUSPAL Title.png


NiGHTS title.png ->











NiGHTS title.png