Difference between revisions of "Template:Icon Big"

From RimWorld Wiki
Jump to navigation Jump to search
(align center)
(Made size and color adjustable. Added Documentation)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<div style='position: static; width: 74px; height: 74px; margin: 0 !important; background-color: rgb{{#show: {{{1|Wood}}} | ?color }} !important; border: 1px solid #000 !important; padding: 4px;' align='center'>
+
<includeonly>{{#vardefine:name| {{{1|{{PAGENAME}}}}} }}<div style='position: static; width: {{#expr:{{{size|64}}}+10}}px; height: {{#expr:{{{size|64}}}+10}}px; margin: 0 !important; background-color: rgb{{{color|{{#show: {{#var:name}} | ?color | default=(265,265,265) }} }}} !important; border: 1px solid #000 !important; padding: 4px'>
[[{{#show: {{{1|Wood}}} | ?image | link = none}}|none|64px|link={{{1|Wood}}}]]
+
<div style='margin: 5px'>[[{{#show: {{#var:name}} | ?image | link = none}}|none|{{{size|64}}}px|link={{#var:name}}]]</div>
</div>
+
</div></includeonly><noinclude>{{Documentation|content=
<noinclude>{{Documentation wanted}}[[Category:Icon templates]]</noinclude>
+
== Usage ==
 +
This template creates a 64px icon in the middle of a 10px larger square. The size and background color can be adjusted.
 +
 
 +
The parameters are:
 +
<pre>
 +
{{Icon Big
 +
| <name>  (optional, type = page, default = {{PAGENAME}} )
 +
| size =  (optional, type = integer, default = 64)
 +
| color = (optional, type = (r,g,b), default = defined on each page or white (265,265,265) )
 +
}}
 +
</pre>
 +
 
 +
== Examples ==
 +
1. Using the template as follows on the page [[wood]] with no parameters would produce:
 +
<pre>{{Icon Big}}</pre>
 +
{{Icon Big|wood}}
 +
 
 +
 
 +
2. Using the template as follows on any page would produce:
 +
<pre>{{Icon Big|steel}}</pre>
 +
{{Icon Big|steel}}
 +
 
 +
 
 +
3. Using the icon from a page with no color defined results in a white background:
 +
<pre>{{Icon Big|Simple meal}}</pre>
 +
{{Icon Big|Simple meal}}
 +
 
 +
 
 +
4. The background color can be set manually:
 +
<pre>{{Icon Big|wood|color=(200,100,100)}}</pre>
 +
{{Icon Big|wood|color=(200,100,100)}}
 +
 
 +
 
 +
5. Using a transparent background is also possible:
 +
<pre>{{Icon Big|Simple meal|color=}}</pre>
 +
{{Icon Big|Simple meal|color=}}
 +
 
 +
 
 +
6. It is also possible to vary the size of the icon:
 +
<pre>{{Icon Big|steel|size=32}}</pre>
 +
{{Icon Big|steel|size=32}}
 +
 
 +
== See also ==
 +
* [[Template:Icon Small]] - for inline icons.
 +
 
 +
[[Category:Icon templates]]
 +
}}</noinclude>

Latest revision as of 11:55, 31 July 2023

Documentation icon Template documentation

Usage

This template creates a 64px icon in the middle of a 10px larger square. The size and background color can be adjusted.

The parameters are:

{{Icon Big
| <name>  (optional, type = page, default = {{PAGENAME}} )
| size =  (optional, type = integer, default = 64)
| color = (optional, type = (r,g,b), default = defined on each page or white (265,265,265) )
}}

Examples

1. Using the template as follows on the page wood with no parameters would produce:

{{Icon Big}}
Woodlog c.png


2. Using the template as follows on any page would produce:

{{Icon Big|steel}}
Steel c.png


3. Using the icon from a page with no color defined results in a white background:

{{Icon Big|Simple meal}}
Simple meal a.png


4. The background color can be set manually:

{{Icon Big|wood|color=(200,100,100)}}
Woodlog c.png


5. Using a transparent background is also possible:

{{Icon Big|Simple meal|color=}}
Simple meal a.png


6. It is also possible to vary the size of the icon:

{{Icon Big|steel|size=32}}
Steel c.png

See also