This is a documentation for Board Game Arena: play board games online !

Template:GameIcon: Difference between revisions

From Board Game Arena
Jump to navigation Jump to search
(calc(-1px *)
m (z-index default value)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
<span style="display:inline-flex;align-items:center;justify-content:space-around;position:relative;height:{{{height}}}px;width:{{{width}}}px;overflow:hidden;color:{{{textColor|#000}}};font-family:Roboto,Arial,sans-serif;font-weight:700;font-size:16px;text-shadow:0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}};"><span style="position:absolute;left:calc(-1px * {{{x|0}}});top:calc(-1px * {{{y|0}}});">[[File:{{{imageFileName}}}|link=|{{{tooltip|}}}]]</span><span style="position:relative;white-space:nowrap;">{{{|&#8203;}}}</span></span><noinclude>
<span style="display:inline-flex;align-items:center;justify-content:space-around;position:relative;z-index:{{{z}}};height:calc(1px*{{{height}}});width:calc(1px*{{{width}}});overflow:hidden;color:{{{textColor|#000}}};font-family:Roboto,Arial,sans-serif;font-weight:700;font-size:16px;text-shadow:0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}},0 0 2px {{{outlineColor|#fff0}}};"><span style="position:absolute;left:calc(-1px*{{{x|0}}});top:calc(-1px*{{{y|0}}});transform-origin:top left;transform:scale({{{scale|1}}});">[[File:{{{imageFileName}}}|link=|{{{tooltip|&#8203;}}}]]</span><span style="position:relative;white-space:nowrap;">{{{|&ZeroWidthSpace;}}}</span></span><noinclude>


Use this <code><nowiki>{{gameIcon}}</nowiki></code> template to display a game-specific image:
{{infoBox |maxWidth= |color=#37c |titleAlign=left
<pre>
|title=Step 1
|body='''[[Special:Upload|Upload]]''' '''''YourImage'''''.png
}}
 
{{infoBox |maxWidth= |color=#3aa |titleAlign=left
|title=Step 2
|body=Create <code>[https://en.doc.boardgamearena.com/Template:YourIcon https://en.doc.boardgamearena.com<wbr>/Template:'''''YourIcon''''']</code>
Fill in the parameters:
<pre style="background:none;border:none;">
{{gameIcon
{{gameIcon
|tooltip=
|tooltip=
|imageFileName=
|imageFileName=
|scale=1
|width=
|width=
|height=
|height=
|x=0
|x=0
|y=0
|y=0
|={{{|&amp;#8203;}}}
|={{{1|&amp;ZeroWidthSpace;}}}
|textColor=black
|textColor=black
|outlineColor=white
|outlineColor=white
}}<nowiki><</nowiki>noinclude<nowiki>>
}}<nowiki><</nowiki>noinclude<nowiki>>
[[Category:GameNameIcons]]
[[Category:YourIcons]]
<</nowiki>noinclude<nowiki>></nowiki>
<</nowiki>noinclude<nowiki>></nowiki>
</pre>
</pre>
}}
{{infoBox |maxWidth= |color=#3c7 |titleAlign=left
|title=Step 3
|body=Insert <code><nowiki>{{</nowiki>'''''YourIcon'''''<nowiki>}}</nowiki></code>
}}
== Examples ==
=== Jump Drive ===
{{infoBox |maxWidth= |color=#37c |titleAlign=left
|title=Step 1
|body=<span style="display:inline-flex;flex-direction:column;gap:0.5rem;"><span>'''[[Special:Upload|Upload]]''' <code>JumpDriveIcons.png</code> (450×30 pixels)</span>[[File:JumpDriveIcons.png]]</span>.
}}


== Available parameters ==
{{infoBox |maxWidth= |color=#3aa |titleAlign=left
|title=Step 2
|body=Create <code>[https://en.doc.boardgamearena.com/Template:JumpDriveGenes https://en.doc.boardgamearena.com<wbr>/Template:'''''JumpDriveGenes''''']</code>:
<pre style="background:none;border:none;">
{{gameIcon
|tooltip=Genes
|imageFileName=JumpDriveIcons.png
|width=30
|height=30
|x=60
|y=0
|={{{1|&amp;ZeroWidthSpace;}}}
|textColor=black
|outlineColor=white
}}<nowiki><</nowiki>noinclude<nowiki>>
[[Category:JumpDriveIcons]]
<</nowiki>noinclude<nowiki>></nowiki>
</pre>
}}
 
{{infoBox |maxWidth= |color=#3c7 |titleAlign=left
|title=Step 3
|body=Insert <code><nowiki>{{JumpDriveGenes|1}}</nowiki></code> {{JumpDriveGenes|1}} in '''[[Gamehelpjumpdrive]]'''.
}}
 
=== Space Station Phoenix ===
 
{{infoBox |maxWidth= |color=#37c |titleAlign=left
|title=Step 1
|body=<span style="display:inline-flex;flex-direction:column;gap:0.5rem;"><span>'''[[Special:Upload|Upload]]''' <code>SpaceStationPhoenixIcons.png</code> (700×100 pixels).</span>[[File:SpaceStationPhoenixIcons.png]]</span>
}}
 
{{infoBox |maxWidth= |color=#3aa |titleAlign=left
|title=Step 2
|body=Create <code>[https://en.doc.boardgamearena.com/Template:SSPShipFarm https://en.doc.boardgamearena.com<wbr>/Template:'''''SSPShipFarm''''']</code>:
<pre style="background:none;border:none;">
{{gameIcon
|tooltip=Farm ship
|imageFileName=SpaceStationPhoenixIcons.png
|width=85
|height=50
|x=500
|y=50
}}<nowiki><</nowiki>noinclude<nowiki>>
[[Category:SpaceStationPhoenixIcons]]
<</nowiki>noinclude<nowiki>></nowiki>
</pre>
}}
 
{{infoBox |maxWidth= |color=#3c7 |titleAlign=left
|title=Step 3
|body=Insert <code><nowiki>{{SSPShipFarm}}</nowiki></code> {{SSPShipFarm}} in '''[[Gamehelpspacestationphoenix]]'''.
}}
 
== Parameters ==
<div style="display:grid;grid-template-columns:repeat(3,max-content) 2fr;gap:0.5rem;overflow:auto;text-overflow:ellipsis;">
<div style="display:grid;grid-template-columns:repeat(3,max-content) 2fr;gap:0.5rem;overflow:auto;text-overflow:ellipsis;">
   <div style="font-weight:bold;width:8rem;">Parameter</div>
   <div style="font-weight:bold;width:8rem;">Parameter</div>
Line 25: Line 103:
   <div style="font-weight:bold;width:8rem;">Description</div>
   <div style="font-weight:bold;width:8rem;">Description</div>
   <div><code>tooltip</code></div>
   <div><code>tooltip</code></div>
   <div><code>Game icon</code></div>
   <div><code>&amp;ZeroWidthSpace;</code></div>
   <div><code><nowiki>|tooltip=Resource</nowiki></code></div>
   <div><code><nowiki>|tooltip=Resource</nowiki></code></div>
   <div>'''''Optional:''''' specify a tooltip to display on hover.</div>
   <div>'''''Optional:''''' specify a tooltip to display on hover.</div>
Line 32: Line 110:
   <div><code><nowiki>|imageFileName=JumpDriveIcons.png</nowiki></code></div>
   <div><code><nowiki>|imageFileName=JumpDriveIcons.png</nowiki></code></div>
   <div>'''''Required:''''' specify an '''[[Special:Upload|uploaded]]''' image file name including file format (i.e. <code>.png</code>, <code>.jpg</code> etc.).</div>
   <div>'''''Required:''''' specify an '''[[Special:Upload|uploaded]]''' image file name including file format (i.e. <code>.png</code>, <code>.jpg</code> etc.).</div>
  <div><code>scale</code></div>
  <div><code>1</code></div>
  <div><code><nowiki>|scale=0.5</nowiki></code></div>
  <div>'''''Optional:''''' scale the imageFile with origin in the top left corner.</div>
   <div><code>width</code></div>
   <div><code>width</code></div>
   <div><code>null</code></div>
   <div><code>null</code></div>
Line 43: Line 125:
   <div><code>0</code></div>
   <div><code>0</code></div>
   <div><code><nowiki>|x=60</nowiki></code></div>
   <div><code><nowiki>|x=60</nowiki></code></div>
   <div>'''''Optional:''''' specify the x position in px units.</div>
   <div>'''''Optional:''''' specify the x-axis position in px units.</div>
   <div><code>y</code></div>
   <div><code>y</code></div>
   <div><code>0</code></div>
   <div><code>0</code></div>
   <div><code><nowiki>|y=30</nowiki></code></div>
   <div><code><nowiki>|y=30</nowiki></code></div>
   <div>'''''Optional:''''' specify the y position in px units.</div>
   <div>'''''Optional:''''' specify the y-axis position in px units.</div>
  <div><code>z</code></div>
   <div><code>null</code></div>
   <div><code>null</code></div>
   <div><code><nowiki>{{{|&amp;#8203;}}}</nowiki></code></br>(zero width space)</div>
   <div><code><nowiki>|z=2</nowiki></code></div>
   <div><code><nowiki>|={{{|&amp;#8203;}}}</nowiki></code></div>
  <div>'''''Optional:''''' specify the z-axis position.</div>
  <div><code>null</code></div>
  <div><code><nowiki>&amp;ZeroWidthSpace;</nowiki></code></div>
   <div><code><nowiki>|={{{1|&amp;ZeroWidthSpace;}}}</nowiki></code></div>
   <div>'''''Optional:''''' specify text e.g. via another variable using triple curly braces.</div>
   <div>'''''Optional:''''' specify text e.g. via another variable using triple curly braces.</div>
   <div><code>textColor</code></div>
   <div><code>textColor</code></div>
Line 61: Line 147:
   <div>'''''Optional:''''' specify the text variable outline color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. <code>green</code>.</div>
   <div>'''''Optional:''''' specify the text variable outline color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. <code>green</code>.</div>
</div>
</div>
== Examples ==
=== Jump Drive ===
==== JumpDriveIcons.png ====
450×30 pixels
[[File:JumpDriveIcons.png|JumpDriveIcons.png]]
==== Genes ====
30×30 pixels
{{gameIcon
|tooltip=Genes
|imageFileName=JumpDriveIcons.png
|width=30
|height=30
|x=60
|y=0
|={{{|&#8203;}}}
|textColor=black
|outlineColor=white
}}
<pre>
{{gameIcon
|tooltip=Genes
|imageFileName=JumpDriveIcons.png
|width=30
|height=30
|x=60
|y=0
|={{{|&amp;#8203;}}}
|textColor=black
|outlineColor=white
}}<nowiki><</nowiki>noinclude<nowiki>>
[[Category:JumpDriveIcons]]
<</nowiki>noinclude<nowiki>></nowiki>
</pre>
=== Space Station Phoenix ===
==== SpaceStationPhoenixIcons.png ====
700×100 pixels
[[File:SpaceStationPhoenixIcons.png|SpaceStationPhoenixIcons.png]]
==== Farm ship ====
85×50 pixels
{{gameIcon
|tooltip=Farm ship
|imageFileName=SpaceStationPhoenixIcons.png
|width=85
|height=50
|x=500
|y=50
}}
<pre>
{{gameIcon
|tooltip=Farm ship
|imageFileName=SpaceStationPhoenixIcons.png
|width=85
|height=50
|x=500
|y=50
}}<nowiki><</nowiki>noinclude<nowiki>>
[[Category:SpaceStationPhoenixIcons]]
<</nowiki>noinclude<nowiki>></nowiki>
</pre>


[[Category:GameIconTemplates]]
[[Category:GameIconTemplates]]
</noinclude>
</noinclude>

Latest revision as of 20:16, 24 May 2024

[[File:{{{imageFileName}}}|link=|​]]

Step 1
Upload YourImage.png
Step 2
Create https://en.doc.boardgamearena.com/Template:YourIcon

Fill in the parameters:

{{gameIcon
|tooltip=
|imageFileName=
|scale=1
|width=
|height=
|x=0
|y=0
|={{{1|&ZeroWidthSpace;}}}
|textColor=black
|outlineColor=white
}}<noinclude>
[[Category:YourIcons]]
<noinclude>
Step 3
Insert {{YourIcon}}

Examples

Jump Drive

Step 1
Upload JumpDriveIcons.png (450×30 pixels)JumpDriveIcons.png.
Step 2
Create https://en.doc.boardgamearena.com/Template:JumpDriveGenes:
{{gameIcon
|tooltip=Genes
|imageFileName=JumpDriveIcons.png
|width=30
|height=30
|x=60
|y=0
|={{{1|&ZeroWidthSpace;}}}
|textColor=black
|outlineColor=white
}}<noinclude>
[[Category:JumpDriveIcons]]
<noinclude>
Step 3
Insert {{JumpDriveGenes|1}} genes1 in Gamehelpjumpdrive.

Space Station Phoenix

Step 1
Upload SpaceStationPhoenixIcons.png (700×100 pixels).SpaceStationPhoenixIcons.png
Step 2
Create https://en.doc.boardgamearena.com/Template:SSPShipFarm:
{{gameIcon
|tooltip=Farm ship
|imageFileName=SpaceStationPhoenixIcons.png
|width=85
|height=50
|x=500
|y=50
}}<noinclude>
[[Category:SpaceStationPhoenixIcons]]
<noinclude>
Step 3
Insert {{SSPShipFarm}} Farm ship in Gamehelpspacestationphoenix.

Parameters

Parameter
Default value
Example
Description
tooltip
&ZeroWidthSpace;
|tooltip=Resource
Optional: specify a tooltip to display on hover.
imageFileName
null
|imageFileName=JumpDriveIcons.png
Required: specify an uploaded image file name including file format (i.e. .png, .jpg etc.).
scale
1
|scale=0.5
Optional: scale the imageFile with origin in the top left corner.
width
null
|width=30
Required: specify the icon width in px units.
height
null
|height=30
Required: specify the icon height in px units.
x
0
|x=60
Optional: specify the x-axis position in px units.
y
0
|y=30
Optional: specify the y-axis position in px units.
z
null
|z=2
Optional: specify the z-axis position.
null
&ZeroWidthSpace;
|={{{1|&ZeroWidthSpace;}}}
Optional: specify text e.g. via another variable using triple curly braces.
textColor
#000
(black)
|textColor=green
Optional: specify the text variable color as a CSS color e.g. green.
outlineColor
#fff0
(transparent white)
|outlineColor=green
Optional: specify the text variable outline color as a CSS color e.g. green.