tableImage: Difference between revisions
Jump to navigation
Jump to search
m (Conversion script moved page tableImage to TableImage without leaving a redirect: Converting page title to first-letter uppercase) |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
|version=1.3b40 | |version=1.3b40 | ||
|description= | |description= | ||
Gets the image asset value from the specified [[Table|table]]. If the | Gets the image asset value from the specified [[Table|table]]. If the roll is not specified then the default [[Roll|roll]] for the [[Table|table]] is used. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
tableImage(name) | tableImage(name) | ||
tableImage(name, | tableImage(name, roll) | ||
tableImage(name, | tableImage(name, roll, size) | ||
tblImage(name) | tblImage(name) | ||
tblImage(name, | tblImage(name, roll) | ||
tblImage(name, | tblImage(name, roll, size) | ||
</ | </syntaxhighlight> | ||
'''Parameters''' | '''Parameters''' | ||
* {{code|name}} - A string containing the name of the [[Table|table]]. | * {{code|name}} - A string containing the name of the [[Table|table]]. | ||
* {{code|row}} - The | * {{code|row}} - The entry of the [[Table|table]] that should have the image asset returned. | ||
* {{code|size}} - The size the image asset returned should be. If the image is not square, this will be the size of the height. | * {{code|size}} - The size the image asset returned should be. If the image is not square, this will be the size of the height. | ||
|examples= | |examples= | ||
'''Example 1:''' Display a random image from [[Table|table]] {{code|"tbl1"}} using default [[Roll|roll]]: | '''Example 1:''' Display a random image from [[Table|table]] {{code|"tbl1"}} using default [[Roll|roll]]: | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
<image src='[r: tableImage("tbl1")]'></image> | <image src='[r: tableImage("tbl1")]'></image> | ||
</ | </syntaxhighlight> | ||
'''Example 1:''' Display the first image from [[Table|table]] {{code|"tbl1"}}: | '''Example 1:''' Display the first image from [[Table|table]] {{code|"tbl1"}}: | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
<image src='[r: tableImage("tbl1", 1)]'></image> | <image src='[r: tableImage("tbl1", 1)]'></image> | ||
</ | </syntaxhighlight> | ||
'''Example 2:''' Display one of the first four images, resized to {{code|40}} pixels tall, from {{code|"tbl1"}}, chosed randomly: | '''Example 2:''' Display one of the first four images, resized to {{code|40}} pixels tall, from {{code|"tbl1"}}, chosed randomly: | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
<image src='[r: tableImage("tbl1", "1d4", 40)]'></image> | <image src='[r: tableImage("tbl1", "1d4", 40)]'></image> | ||
</ | </syntaxhighlight> | ||
<i>'''Note:''' In these examples, an image is sent into the chat. When sending multiple images to chat, a rendering issue can occur where images are not fully displayed until the chat panel is updated. Adding a {{code|width}} attribute to your {{code|image}} or {{code|img}} tags can work around this issue if you are experiencing it.</i> | <i>'''Note:''' In these examples, an image is sent into the chat. When sending multiple images to chat, a rendering issue can occur where images are not fully displayed until the chat panel is updated. Adding a {{code|width}} attribute to your {{code|image}} or {{code|img}} tags can work around this issue if you are experiencing it.</i> | ||
Latest revision as of 23:59, 15 July 2024
tableImage() Function
• Introduced in version 1.3b40
Gets the image asset value from the specified table. If the roll is not specified then the default roll for the table is used.
Usage
tableImage(name)
tableImage(name, roll)
tableImage(name, roll, size)
tblImage(name)
tblImage(name, roll)
tblImage(name, roll, size)
Parameters
name
- A string containing the name of the table.row
- The entry of the table that should have the image asset returned.size
- The size the image asset returned should be. If the image is not square, this will be the size of the height.
Examples
Example 1: Display a random image from table
Note: In these examples, an image is sent into the chat. When sending multiple images to chat, a rendering issue can occur where images are not fully displayed until the chat panel is updated. Adding a
"tbl1"
using default roll:
<image src='[r: tableImage("tbl1")]'></image>
Example 1: Display the first image from table "tbl1"
:
<image src='[r: tableImage("tbl1", 1)]'></image>
Example 2: Display one of the first four images, resized to 40
pixels tall, from "tbl1"
, chosed randomly:
<image src='[r: tableImage("tbl1", "1d4", 40)]'></image>
width
attribute to your image
or img
tags can work around this issue if you are experiencing it.