Template:KeyLarge: Difference between revisions

From OniGalore
(Created page with "<includeonly><div style=" width:{{#expr:95*({{{scale|100}}}/100)}}px; height:{{#expr:95*({{{scale|100}}}/100)}}px; text-align:center; border:solid; border-color:#898989 #dddddd #dddddd #898989; border-width:{{#expr:5.0*({{{scale|100}}}/100)}}px {{#expr:5.0*({{{scale|100}}}/100)}}px {{#expr:3.0*({{{scale|100}}}/100)}}px {{#expr:3.0*({{{scale|100}}}/100)}}px; border-radius:{{#expr:1.0*({{{scale|100}}}/100)}}em; box-shadow:inset 0rem -0.8rem 2rem #dadada,...")
 
m (updated doc template calls for new name)
 
(4 intermediate revisions by the same user not shown)
Line 21: Line 21:
     position:relative;">{{{bot_char}}}</span><!--
     position:relative;">{{{bot_char}}}</span><!--
--></div></includeonly><noinclude>
--></div></includeonly><noinclude>
Call this template when you want to draw an image of a keyboard button.
Call this template when you want to draw an image of a large keyboard button, as seen at {{SectionLink|Developer Mode|Using the console}}. Currently only designed to display buttons with two symbols on them. For a small button that can be printed inline with text, see [[Template:KeySmall]].


==Parameters==
==Parameters==
*'''top_char''', '''bot_char''': The top and bottom characters which should appear on the button.
*'''top_char''', '''bot_char''': The top and bottom characters which should appear on the button.
*'''scale''': A percentage, default value of 100. At 100, the button will be 95x95 px.
*'''scale''': A percentage, default value of 100. At 100, the button will be 95x95 px.
*'''top_scale''', '''bot_scale''': The font size of the top and bottom characters, as a scaling factor for the default font size of 150%. The font size will automatically scale with the use of '''scale''', but you will find that certain characters need to have their scaling fine-tuned to look good on the button. These parameters will add a further multiplier to the '''scale''' multiplier, e.g. setting '''bot_scale''' to 133 on a 50%-scale button will produce a 100% font size: 150 * 0.5 * 1.33 = ~100.
*'''top_scale''', '''bot_scale''': The font size of the top and bottom characters, as a scaling factor for the default font size of 150%. The font size will automatically scale with the use of '''scale''', but you will find that certain characters need to have their scaling fine-tuned to look good on the button. These parameters will add a further multiplier to the '''scale''' multiplier, e.g. setting '''bot_scale''' to 133 on a 50%-scale button will raise the font size from 75% (150 * 0.5) to 100% (150 * 0.5 * 1.33).


==Sample usage==
==Sample usage==
<tt><nowiki>{{KeyboardButton|top_char=§|bot_char=½}}</nowiki></tt><br>
<tt><nowiki>{{KeyLarge|top_char=§|bot_char=½}}</nowiki></tt><br>
yields:<br>
yields:<br>
{{KeyboardButton|top_char=§|bot_char=½}}
{{KeyLarge|top_char=§|bot_char=½}}




<tt><nowiki>{{KeyboardButton|top_char=~|top_scale=117|bot_char=`|bot_scale=133}}</nowiki></tt><br>
<tt><nowiki>{{KeyLarge|top_char=~|top_scale=117|bot_char=`|bot_scale=133}}</nowiki></tt><br>
yields:<br>
yields:<br>
{{KeyboardButton|top_char=~|top_scale=117|bot_char=`|bot_scale=133}}
{{KeyLarge|top_char=~|top_scale=117|bot_char=`|bot_scale=133}}
vs. how it would look without the special scaling for each character:<br>
{{KeyLarge|top_char=~|bot_char=`}}




With <tt>scale=50</tt> added:<br>
The same button at 50% scale:<br>
<tt><nowiki>{{KeyboardButton|scale=50|top_char=~|top_scale=117|bot_char=`|bot_scale=133}}</nowiki></tt><br>
<tt><nowiki>{{KeyLarge|scale=50|top_char=~|top_scale=117|bot_char=`|bot_scale=133}}</nowiki></tt><br>
yields:<br>
yields:<br>
{{KeyboardButton|scale=50|top_char=~|top_scale=117|bot_char=`|bot_scale=133}}
{{KeyLarge|scale=50|top_char=~|top_scale=117|bot_char=`|bot_scale=133}}


[[Category:Basic formatting templates]]</noinclude>
[[Category:Basic formatting templates]]</noinclude>

Latest revision as of 22:43, 2 May 2025

Call this template when you want to draw an image of a large keyboard button, as seen at Developer Mode § Using the console. Currently only designed to display buttons with two symbols on them. For a small button that can be printed inline with text, see Template:KeySmall.

Parameters

  • top_char, bot_char: The top and bottom characters which should appear on the button.
  • scale: A percentage, default value of 100. At 100, the button will be 95x95 px.
  • top_scale, bot_scale: The font size of the top and bottom characters, as a scaling factor for the default font size of 150%. The font size will automatically scale with the use of scale, but you will find that certain characters need to have their scaling fine-tuned to look good on the button. These parameters will add a further multiplier to the scale multiplier, e.g. setting bot_scale to 133 on a 50%-scale button will raise the font size from 75% (150 * 0.5) to 100% (150 * 0.5 * 1.33).

Sample usage

{{KeyLarge|top_char=§|bot_char=½}}
yields:

§
½


{{KeyLarge|top_char=~|top_scale=117|bot_char=`|bot_scale=133}}
yields:

~
`

vs. how it would look without the special scaling for each character:

~
`


The same button at 50% scale:
{{KeyLarge|scale=50|top_char=~|top_scale=117|bot_char=`|bot_scale=133}}
yields:

~
`