setSize: Difference between revisions
mNo edit summary |
(Removed note about error for free size / native size tokens. Fixed.) |
||
Line 65: | Line 65: | ||
{{param|size|The [[Size]] to set the token to.}} | {{param|size|The [[Size]] to set the token to.}} | ||
{{param|id|The token {{code|id}} of the token which has its [[Size]] set, defaults to the [[Current Token]].}} | {{param|id|The token {{code|id}} of the token which has its [[Size]] set, defaults to the [[Current Token]].}} | ||
|examples= | |examples= |
Revision as of 12:55, 13 August 2019
setSize() Function
Note: This function can only be used in a Trusted Macro
Grid Sizes and Scales
The valid sizes for each type of grid are documented below, where Medium is always 1 full grid cell. The Scale is a multiplier for the size of the image after configuring it to fit within the stated footprint. For example, the Huge
size on a square grid occupies a 3x3 cell area and the image is scaled (1.0) to exactly fit that area. But the Large
size on a hex grid is 3 hexes scaled down 10% (0.9) so as to keep the image slightly within the border of the 3 cells.
Hex Grid | Scale |
---|---|
1/6 | 0.408 |
1/4 | 0.5 |
1/3 | 0.577 |
1/2 | 0.707 |
2/3 | 0.816 |
Medium | 1.0 |
Large | 0.9 (3 cells) |
Huge | 1.0 (6 cells) |
Humongous | 1.0 (19 cells) |
Square Grid | Scale |
---|---|
Fine | 0.5 |
Diminutive | 0.5 |
Tiny | 0.5 |
Small | 0.75 |
Medium | 1.0 |
Large | 1.0 (2x2) |
Huge | 1.0 (3x3) |
Gargantuan | 1.0 (4x4) |
Colossal | 1.0 (6x6) |
Gridless | Scale | Gridless | Scale | Gridless | Scale |
---|---|---|---|---|---|
-11 | 0.086 | 0 | 1.0 | 11 | 7.43 |
-10 | 0.107 | 1 | 1.2 | 12 | 8.916 |
-9 | 0.134 | 2 | 1.44 | 13 | 10.699 |
-8 | 0.168 | 3 | 1.728 | 14 | 12.839 |
-7 | 0.21 | 4 | 2.074 | 15 | 15.407 |
-6 | 0.262 | 5 | 2.488 | 16 | 18.488 |
-5 | 0.328 | 6 | 2.986 | 17 | 22.186 |
-4 | 0.41 | 7 | 3.583 | 18 | 26.623 |
-3 | 0.512 | 8 | 4.3 | 19 | 31.948 |
-2 | 0.64 | 9 | 5.16 | 20 | 38.338 |
-1 | 0.8 | 10 | 6.192 |
Needs Clarification:
It would be nice to include pictures that demonstrate how the grid cells are composed; at least for the hex grids.
Usage
setSize(size)
setSize(size, id)
Parameters
size
- The Size to set the token to.id
- The tokenid
of the token which has its Size set, defaults to the Current Token.
Examples
Medium
:
[h: setSize("Medium")]
To set the size of the current token to whatever string is stored in the macro variable mySize:
[h: mySize = "Large"]
[h: setSize(mySize)]
See Also
Version Changes
- 1.3b51 - Added
id
parameter option.