herolab.getImage: Difference between revisions
Jump to navigation
Jump to search
(New Hero Lab function.) |
No edit summary |
||
Line 4: | Line 4: | ||
|version=1.5 | |version=1.5 | ||
|description= | |description= | ||
Returns the asset id of the image retrieved from Hero Lab for a Token | Returns the asset id of the image retrieved from a Hero Lab file for a Token. | ||
|usage= | |usage= | ||
Line 16: | Line 16: | ||
{{param|id|The token id of the token to name, defaults to the Current Token.}} | {{param|id|The token id of the token to name, defaults to the Current Token.}} | ||
Hero Lab can store 0 to n images for a given character. The index is the order Hero Lab stores the images (not the display order in Hero lab). Index always starts at 0. | |||
|example= | |example= | ||
Get an image asset ID from an image in a Hero Lab file and use that to set a token portrait image. | |||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[portraitImage = herolab.getImage(0)] | [portraitImage = herolab.getImage(0)] | ||
Line 30: | Line 30: | ||
|also= | |also= | ||
[[:Category:Hero Lab Function|Hero Lab Functions]]<br/> | |||
[[Hero Lab Integration|Hero Lab Integration]] | [[Hero Lab Integration|Hero Lab Integration]] | ||
Revision as of 14:57, 5 March 2019
herolab.getImage() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.5
Returns the asset id of the image retrieved from a Hero Lab file for a Token.
Usage
herolab.getImage(index)
herolab.getImage(index, id)
Parameters
index
- The index of the image you wish to retrieve.id
- The token id of the token to name, defaults to the Current Token.
Hero Lab can store 0 to n images for a given character. The index is the order Hero Lab stores the images (not the display order in Hero lab). Index always starts at 0.
Example
Get an image asset ID from an image in a Hero Lab file and use that to set a token portrait image.
[portraitImage = herolab.getImage(0)]
[setTokenImage(portraitImage)]
Returns:
Asset ID of requested image.
See Also
Version Changes
- 1.5 - Added to main MapTool build.