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

Template:HexMap: Difference between revisions

From Board Game Arena
Jump to navigation Jump to search
Sammy McSam (talk | contribs)
gap parameter, place-items:center
Sammy McSam (talk | contribs)
m <onlyinclude>
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<div style="position:relative;display:grid;grid:auto-flow calc(0.5px*{{{x|67.195}}})/repeat({{{w|auto-fit}}},calc(0.75px*{{{x|67.195}}}/cos(30deg)));{{{|g}}}rid:auto-flow calc(0.75px*{{{x|67.195}}}/cos(30deg))/repeat({{{w|auto-fit}}},calc(0.5px*{{{x|67.195}}}));place-items:center;gap:calc(1px*{{{gap|0}}});width:fit-content;max-width:100vw;background:{{{bg|transparent}}};border-radius:8px;padding:16px;margin-top:8px;white-space:nowrap;"><div style="position:absolute;display:flex;{{{n|display:none}}};justify-content:center;align-items:center;top:8px;left:16px;padding:4px;width:fit-content;min-width:28px;min-height:28px;background:{{{n-bg|#199}}};border-radius:28px;line-height:1;color:{{{n-c|#fff}}};font-family:Roboto,Arial,sans-serif;font-weight:700;font-size:24px;">{{{n|}}}</div>{{{1|}}}</div><noinclude>
<onlyinclude><div style="position:relative;display:grid;grid:auto-flow calc(0.5px*{{{x|67.195}}})/repeat({{{w|auto-fit}}},calc(0.75px*{{{x|67.195}}}/cos(30deg)));{{{|g}}}rid:auto-flow calc(0.75px*{{{x|67.195}}}/cos(30deg))/repeat({{{w|auto-fit}}},calc(0.5px*{{{x|67.195}}}));place-items:center;gap:calc(1px*{{{gap|0}}});width:fit-content;max-width:100vw;background:{{{bg|transparent}}};border-radius:8px;padding:16px;margin-top:8px;white-space:nowrap;"><div style="position:absolute;display:flex;{{{n|display:none}}};justify-content:center;align-items:center;top:8px;left:16px;padding:4px;width:fit-content;min-width:28px;min-height:28px;background:{{{n-bg|#199}}};border-radius:28px;line-height:1;color:{{{n-c|#fff}}};font-family:Roboto,Arial,sans-serif;font-weight:700;font-size:24px;">{{{n|}}}</div>{{{1|}}}</div></onlyinclude>


A map for '''[[Template:Hex]]es''' and other hexagonal pieces.
A map for '''[[Template:Hex]]es''' and other hexagonal pieces.
Line 8: Line 8:


{{hexMap|
{{hexMap|
{{hiveAnt          |x=1 |y=2 }}
{{hiveBeetle        |x=2 |y=3 }}
{{hiveGrasshopper  |x=4 |y=3 }}
{{hiveSpider        |x=5 |y=2 }}


{{hiveAnt          |r=3  |x=1 |y=2 }}
{{hiveBee|w=        |x=3 |y=2 }}
{{hiveBeetle        |r=1  |x=2 |y=3 }}
{{hiveGrasshopper|w=|x=2 |y=1 }}
{{hiveGrasshopper  |r=11 |x=4 |y=3 }}
{{hiveSpider|w=    |x=4 |y=1 }}
{{hiveSpider        |r=9  |x=5 |y=2 }}
 
{{hiveBee|w=        |r=0  |x=3 |y=2 }}
{{hiveGrasshopper|w=|r=0  |x=2 |y=1 }}
{{hiveSpider|w=    |r=0  |x=4 |y=1 }}
}}
}}


<pre style="background:none;border:none;">
<pre style="background:none;border:none;">
{{hexMap|gap=2|
{{hexMap|gap=2|
{{hiveAnt          |x=1 |y=2 }}
{{hiveBeetle        |x=2 |y=3 }}
{{hiveGrasshopper  |x=4 |y=3 }}
{{hiveSpider        |x=5 |y=2 }}


{{hiveAnt          |r=3  |x=1 |y=2 }}
{{hiveBee|w=        |x=3 |y=2 }}
{{hiveBeetle        |r=1  |x=2 |y=3 }}
{{hiveGrasshopper|w=|x=2 |y=1 }}
{{hiveGrasshopper  |r=11 |x=4 |y=3 }}
{{hiveSpider|w=    |x=4 |y=1 }}
{{hiveSpider        |r=9  |x=5 |y=2 }}
 
{{hiveBee|w=        |r=0  |x=3 |y=2 }}
{{hiveGrasshopper|w=|r=0  |x=2 |y=1 }}
{{hiveSpider|w=    |r=0  |x=4 |y=1 }}
}}
}}
</pre>
</pre>
Line 35: Line 33:
<div style="display:flex;gap:0 8px;flex-wrap:wrap;">
<div style="display:flex;gap:0 8px;flex-wrap:wrap;">
{{hexMap |n=1 |
{{hexMap |n=1 |
{{hex |x=3 |y=1 |{{TaluvaSand}} |{{meeple|red}}
{{hex |x=3 |y=1 |{{TaluvaSand}} |t={{meeple|red}}
}}
}}
{{hex |x=5 |y=1 |{{TaluvaSand}}
{{hex |x=5 |y=1 |{{TaluvaSand}}
Line 43: Line 41:
{{hex |x=2 |y=2 |{{TaluvaSand}}
{{hex |x=2 |y=2 |{{TaluvaSand}}
}}
}}
{{hex |x=4 |y=2 |{{TaluvaJungle}} |{{meeple|green}}
{{hex |x=4 |y=2 |{{TaluvaJungle}} |t={{meeple|green}}
}}
}}
{{hex |x=6 |y=2 |{{TaluvaJungle}}
{{hex |x=6 |y=2 |{{TaluvaJungle}}
Line 53: Line 51:
{{hex |x=3 |y=3 |{{TaluvaJungle}}
{{hex |x=3 |y=3 |{{TaluvaJungle}}
}}
}}
{{hex |x=5 |y=3 |{{TaluvaClearing}} |{{meeple|blue}}
{{hex |x=5 |y=3 |{{TaluvaClearing}} |t={{meeple|blue}}
}}
}}
{{hex |x=7 |y=3 |{{TaluvaClearing}} |{{meeple|red}}
{{hex |x=7 |y=3 |{{TaluvaClearing}} |t={{meeple|red}}
}}
}}
{{hex |x=2 |y=4 |{{TaluvaSand}} |{{meeple|green}}
{{hex |x=2 |y=4 |{{TaluvaSand}} |t={{meeple|green}}
}}
}}
{{hex |x=4 |y=4 |{{TaluvaJungle}}
{{hex |x=4 |y=4 |{{TaluvaJungle}}
}}
}}
{{hex |x=6 |y=4 |{{TaluvaClearing}} |{{meeple|blue}}
{{hex |x=6 |y=4 |{{TaluvaClearing}} |t={{meeple|blue}}
}}
}}
{{hex |x=8 |y=4 |{{TaluvaClearing}}
{{hex |x=8 |y=4 |{{TaluvaClearing}}
Line 68: Line 66:


{{hexMap |n=2 |
{{hexMap |n=2 |
{{hex |x=3 |y=1 |{{TaluvaSand}} |{{meeple|red}}
{{hex |x=3 |y=1 |{{TaluvaSand}} |t={{meeple|red}}
}}
}}
{{hex |x=5 |y=1 |{{TaluvaSand}}
{{hex |x=5 |y=1 |{{TaluvaSand}}
Line 74: Line 72:
{{hex |x=7 |y=1 |{{TaluvaSand}}
{{hex |x=7 |y=1 |{{TaluvaSand}}
}}
}}
{{hex |x=2 |y=2 |{{TaluvaSand}} |{{meeple|red}}
{{hex |x=2 |y=2 |{{TaluvaSand}} |t={{meeple|red}}
}}
}}
{{hex |x=4 |y=2 |{{TaluvaJungle}} |{{meeple|green}}
{{hex |x=4 |y=2 |{{TaluvaJungle}} |t={{meeple|green}}
}}
}}
{{hex |x=6 |y=2 |{{TaluvaJungle}} |{{meeple|green}}
{{hex |x=6 |y=2 |{{TaluvaJungle}} |t={{meeple|green}}
}}
}}
{{hex |x=8 |y=2 |{{TaluvaJungle}}
{{hex |x=8 |y=2 |{{TaluvaJungle}}
Line 86: Line 84:
{{hex |x=3 |y=3 |{{TaluvaJungle}}
{{hex |x=3 |y=3 |{{TaluvaJungle}}
}}
}}
{{hex |x=5 |y=3 |{{TaluvaClearing}} |{{meeple|blue}}
{{hex |x=5 |y=3 |{{TaluvaClearing}} |t={{meeple|blue}}
}}
}}
{{hex |x=7 |y=3 |{{TaluvaClearing}} |{{meeple|red}}
{{hex |x=7 |y=3 |{{TaluvaClearing}} |t={{meeple|red}}
}}
}}
{{hex |x=2 |y=4 |{{TaluvaSand}} |{{meeple|green}}
{{hex |x=2 |y=4 |{{TaluvaSand}} |t={{meeple|green}}
}}
}}
{{hex |x=4 |y=4 |{{TaluvaJungle}}
{{hex |x=4 |y=4 |{{TaluvaJungle}}
}}
}}
{{hex |x=6 |y=4 |{{TaluvaClearing}} |{{meeple|blue}}{{meeple|blue}}
{{hex |x=6 |y=4 |{{TaluvaClearing}} |t={{meeple|blue}}{{meeple|blue}}
}}
}}
{{hex |x=8 |y=4 |{{TaluvaClearing}}
{{hex |x=8 |y=4 |{{TaluvaClearing}}
Line 103: Line 101:
<pre style="background:none;border:none;">
<pre style="background:none;border:none;">
{{hexMap |n=1 |
{{hexMap |n=1 |
{{hex |x=3 |y=1 |{{TaluvaSand}} |{{meeple|red}}
{{hex |x=3 |y=1 |{{TaluvaSand}} |t={{meeple|red}}
}}
}}
{{hex |x=5 |y=1 |{{TaluvaSand}}
{{hex |x=5 |y=1 |{{TaluvaSand}}
Line 111: Line 109:
{{hex |x=2 |y=2 |{{TaluvaSand}}
{{hex |x=2 |y=2 |{{TaluvaSand}}
}}
}}
{{hex |x=4 |y=2 |{{TaluvaJungle}} |{{meeple|green}}
{{hex |x=4 |y=2 |{{TaluvaJungle}} |t={{meeple|green}}
}}
}}
{{hex |x=6 |y=2 |{{TaluvaJungle}}
{{hex |x=6 |y=2 |{{TaluvaJungle}}
Line 121: Line 119:
{{hex |x=3 |y=3 |{{TaluvaJungle}}
{{hex |x=3 |y=3 |{{TaluvaJungle}}
}}
}}
{{hex |x=5 |y=3 |{{TaluvaClearing}} |{{meeple|blue}}
{{hex |x=5 |y=3 |{{TaluvaClearing}} |t={{meeple|blue}}
}}
}}
{{hex |x=7 |y=3 |{{TaluvaClearing}} |{{meeple|red}}
{{hex |x=7 |y=3 |{{TaluvaClearing}} |t={{meeple|red}}
}}
}}
{{hex |x=2 |y=4 |{{TaluvaSand}} |{{meeple|green}}
{{hex |x=2 |y=4 |{{TaluvaSand}} |t={{meeple|green}}
}}
}}
{{hex |x=4 |y=4 |{{TaluvaJungle}}
{{hex |x=4 |y=4 |{{TaluvaJungle}}
}}
}}
{{hex |x=6 |y=4 |{{TaluvaClearing}} |{{meeple|blue}}
{{hex |x=6 |y=4 |{{TaluvaClearing}} |t={{meeple|blue}}
}}
}}
{{hex |x=8 |y=4 |{{TaluvaClearing}}
{{hex |x=8 |y=4 |{{TaluvaClearing}}
Line 146: Line 144:
   <div><code>null</code></div>
   <div><code>null</code></div>
   <div><code><nowiki>{{HexMap |{{hex}} }}</nowiki></code></div>
   <div><code><nowiki>{{HexMap |{{hex}} }}</nowiki></code></div>
   <div>'''''Optional:''''' place '''[[Template:Hex]]''' tiles on the map.</div>
   <div>place '''[[Template:Hex]]''' tiles on the map.</div>
   <div><code>x</code></div>
   <div><code>x</code></div>
   <div><code>67.195</code></div>
   <div><code>67.195</code></div>
   <div><code><nowiki>{{hexMap |x=80 }}</nowiki></code></div>
   <div><code><nowiki>{{hexMap |x=80 }}</nowiki></code></div>
   <div>'''''Optional:''''' specify the grid hex width in px units.</div>
   <div>grid hex width in px units.</div>
   <div><code>gap</code></div>
   <div><code>gap</code></div>
   <div><code>0</code></div>
   <div><code>0</code></div>
   <div><code><nowiki>{{hexMap |gap=4 }}</nowiki></code></div>
   <div><code><nowiki>{{hexMap |gap=4 }}</nowiki></code></div>
   <div>'''''Optional:''''' specify the gap between hexes in px units.</div>
   <div>gap between hexes in px units.</div>
   <div><code>w</code></div>
   <div><code>w</code></div>
   <div><code>auto-fit</code></div>
   <div><code>auto-fit</code></div>
   <div><code><nowiki>{{hexMap |w=20 }}</nowiki></code></div>
   <div><code><nowiki>{{hexMap |w=20 }}</nowiki></code></div>
   <div>'''''Optional:''''' specify the grid width in hexes.</div>
   <div>grid width in hexes.</div>
   <div><code>bg</code></div>
   <div><code>bg</code></div>
   <div><code>transparent</code></div>
   <div><code>transparent</code></div>
   <div><code><nowiki>{{hexMap |bg=green }}</nowiki></code></div>
   <div><code><nowiki>{{hexMap |bg=green }}</nowiki></code></div>
   <div>'''''Optional:''''' specify the background as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color].</div>
   <div>background as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color].</div>
   <div><code>n</code></div>
   <div><code>n</code></div>
   <div><code>null</code></div>
   <div><code>null</code></div>
   <div><code><nowiki>{{HexMap |n=1 }}</nowiki></code></div>
   <div><code><nowiki>{{HexMap |n=1 }}</nowiki></code></div>
   <div>'''''Optional:''''' specify text in the top left corner of the map.</div>
   <div>text in the top left corner of the map.</div>
   <div><code>n-c</code></div>
   <div><code>n-c</code></div>
   <div><code>#fff</code> (white)</div>
   <div><code>#fff</code> (white)</div>
   <div><code><nowiki>{{hexMap |n-c=green }}</nowiki></code></div>
   <div><code><nowiki>{{hexMap |n-c=green }}</nowiki></code></div>
   <div>'''''Optional:''''' specify the text color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color].</div>
   <div>text color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color].</div>
   <div><code>n-bg</code></div>
   <div><code>n-bg</code></div>
   <div><code>#199</code> (teal)</div>
   <div><code>#199</code> (teal)</div>
   <div><code><nowiki>{{hexMap |n-bg=green }}</nowiki></code></div>
   <div><code><nowiki>{{hexMap |n-bg=green }}</nowiki></code></div>
   <div>'''''Optional:''''' specify the text background as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color].</div>
   <div>text background as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color].</div>
</div>
</div>
== [[:Category:GameBoardTemplates]] ==
{{Category:GameBoardTemplates}}
== Pages using {{FULLPAGENAME}} ==
{{Special:WhatLinksHere/{{FULLPAGENAME}}}}


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

Latest revision as of 22:00, 23 October 2026

A map for Template:Hexes and other hexagonal pieces.

Examples

Hive

Soldier Ant​
Beetle​
Grasshopper​
Spider​
Queen Bee​
Grasshopper​
Spider​
{{hexMap|gap=2|
{{hiveAnt           |x=1 |y=2 }}
{{hiveBeetle        |x=2 |y=3 }}
{{hiveGrasshopper   |x=4 |y=3 }}
{{hiveSpider        |x=5 |y=2 }}

{{hiveBee|w=        |x=3 |y=2 }}
{{hiveGrasshopper|w=|x=2 |y=1 }}
{{hiveSpider|w=     |x=4 |y=1 }}
}}

1
Sand​
red meeple​
Sand​
​
Sand​
​
Sand​
​
Jungle​
green meeple​
Jungle​
​
Jungle​
​
Sand​
​
Jungle​
​
Clearing​
blue meeple​
Clearing​
red meeple​
Sand​
green meeple​
Jungle​
​
Clearing​
blue meeple​
Clearing​
​
2
Sand​
red meeple​
Sand​
​
Sand​
​
Sand​
red meeple​
Jungle​
green meeple​
Jungle​
green meeple​
Jungle​
​
Sand​
​
Jungle​
​
Clearing​
blue meeple​
Clearing​
red meeple​
Sand​
green meeple​
Jungle​
​
Clearing​
blue meeple​blue meeple​
Clearing​
​
{{hexMap |n=1 |
{{hex |x=3 |y=1 |{{TaluvaSand}} |t={{meeple|red}}
}}
{{hex |x=5 |y=1 |{{TaluvaSand}}
}}
{{hex |x=7 |y=1 |{{TaluvaSand}}
}}
{{hex |x=2 |y=2 |{{TaluvaSand}}
}}
{{hex |x=4 |y=2 |{{TaluvaJungle}} |t={{meeple|green}}
}}
{{hex |x=6 |y=2 |{{TaluvaJungle}}
}}
{{hex |x=8 |y=2 |{{TaluvaJungle}}
}}
{{hex |x=1 |y=3 |{{TaluvaSand}}
}}
{{hex |x=3 |y=3 |{{TaluvaJungle}}
}}
{{hex |x=5 |y=3 |{{TaluvaClearing}} |t={{meeple|blue}}
}}
{{hex |x=7 |y=3 |{{TaluvaClearing}} |t={{meeple|red}}
}}
{{hex |x=2 |y=4 |{{TaluvaSand}} |t={{meeple|green}}
}}
{{hex |x=4 |y=4 |{{TaluvaJungle}}
}}
{{hex |x=6 |y=4 |{{TaluvaClearing}} |t={{meeple|blue}}
}}
{{hex |x=8 |y=4 |{{TaluvaClearing}}
}}
}}

Parameters

Parameter
Default value
Example
Description
1
null
{{HexMap |{{hex}} }}
place Template:Hex tiles on the map.
x
67.195
{{hexMap |x=80 }}
grid hex width in px units.
gap
0
{{hexMap |gap=4 }}
gap between hexes in px units.
w
auto-fit
{{hexMap |w=20 }}
grid width in hexes.
bg
transparent
{{hexMap |bg=green }}
background as a CSS color.
n
null
{{HexMap |n=1 }}
text in the top left corner of the map.
n-c
#fff (white)
{{hexMap |n-c=green }}
text color as a CSS color.
n-bg
#199 (teal)
{{hexMap |n-bg=green }}
text background as a CSS color.

Category:GameBoardTemplates

For documentation on using game board templates on BGA wiki pages, see Template:Chessboard and Template:Goboard9.

Pages using Template:HexMap