tableImage: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function tableImage== Gets the image asset value from the specified Table. If the row is not specified then the default Macros:roll for the Table is used. The row can be ei...)
 
m (Applied Template:MacroFunction)
Line 1: Line 1:
==Function tableImage==
{{MacroFunction
 
|name=tableImage
|description=
Gets the image asset value from the specified [[Table]]. If the row is not specified then the default [[Macros:roll|roll]] for the [[Table]] is used. The row can be either a constant or a [[Macros:roll|roll]].
Gets the image asset value from the specified [[Table]]. If the row is not specified then the default [[Macros:roll|roll]] for the [[Table]] is used. The row can be either a constant or a [[Macros:roll|roll]].


===Usage===
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
     [h: tableImage(tableName)]
     [h: tableImage(tableName)]
Line 10: Line 11:
</source>
</source>
   
   
===Examples===
|examples=
Display a random image from table "tbl1" using default roll.
Display a random image from table "tbl1" using default roll.
<source lang="mtmacro" line>
<source lang="mtmacro" line>
Line 25: Line 26:
     <image src='[r: tableImage("tbl1", "1d4", 40)]'></image>
     <image src='[r: tableImage("tbl1", "1d4", 40)]'></image>
</source>
</source>
}}
[[Category:Table Function]]

Revision as of 05:34, 9 March 2009

tableImage() Function

Gets the image asset value from the specified Table. If the row is not specified then the default roll for the Table is used. The row can be either a constant or a roll.

Usage

    [h: tableImage(tableName)]
    [h: tableImage(tableName, row)]
    [h: tableImage(tableName, row, size)]

Examples

Display a random image from table "tbl1" using default roll.
    <image src='[r: tableImage("tbl1")]'></image>

Display the first image from table "tbl1".

    <image src='[r: tableImage("tbl1", 1)]'></image>

Display one of the first 4 images resized to 40 pixels high from "tbl1" chosed randomly. >

    <image src='[r: tableImage("tbl1", "1d4", 40)]'></image>