Actions

Template

Difference between revisions of "Bobscreen"

From NEC Retro

(Undo revision 10048 by Ccawley2011 (talk))
Tag: Undo
Line 1: Line 1:
<includeonly>{{#if:{{{noresize|}}}|[[File:{{{1|Notavailable.svg}}}{{#if:{{{width|}}}{{{height|}}}|{{!}}}}{{#if:{{{width|}}}|{{{width|}}}}}{{#if:{{{height|}}}|x{{{height|}}}}}{{#if:{{{width|}}}{{{height|}}}|px}}]]|{{let|imagedim={{#replace:{{#mediadimensions:{{{1|Notavailable.svg}}}}}|,|}}}}{{let|imagew={{#explode:{{#var:imagedim}}|×|0}}|imageh={{#explode:{{#var:imagedim}}|×|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}}}}
 
{{let|bsparams={{#switch:{{#var:imagedim}}
 
{{let|bsparams={{#switch:{{#var:imagedim}}
 
<!--thumbnail width, display width, display height, crop (top, bottom, left, right)-->
 
<!--thumbnail width, display width, display height, crop (top, bottom, left, right)-->
Line 102: Line 102:
 
left:-{{#expr:{{#var:bsl}}*{{#var:scale}}}}px
 
left:-{{#expr:{{#var:bsl}}*{{#var:scale}}}}px
 
">
 
">
[[File:{{{1|Notavailable.svg}}}|{{#expr:trunc({{#var:thumbw}}*{{#var:scale}})}}px|link={{{link|File:{{{1|Notavailable.svg}}}}}}]]
+
[[File:{{{1|}}}|{{#expr:trunc({{#var:thumbw}}*{{#var:scale}})}}px|link={{{link|File:{{{1|}}}}}}]]
 
</div>
 
</div>
 
</div>
 
</div>

Revision as of 18:50, 31 December 2021


This template sets the maximum width of a screenshot to 320 pixels, and corrects its aspect ratio.

Usage

{{bobscreen|MagicalPuzzlePopils title.png}}

returns

BariBariDensetsu PCE title.png

This is how the game appears on an actual PC Engine. The original image taken from an emulator is below:

BariBariDensetsu PCE title.png

Options

{{bobscreen|BariBariDensetsu PCE title.png|width=120}}

returns

BariBariDensetsu PCE 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.