Difference between revisions of "Ryzom API/Item icon"
From EncyclopAtys
(Created page with "<noinclude>___TOC__</noinclude> Retrieves Item icons === Usage === <base URL>/item_icon.php?sheetid=iczahp_3.sitem&c=1&q=0&s=0&sap=-1&destroyed=0&label=1&locked=0 ==== URL...") |
|||
Line 1: | Line 1: | ||
− | <noinclude> | + | <noinclude>__TOC__</noinclude> |
Retrieves Item icons | Retrieves Item icons | ||
Line 11: | Line 11: | ||
! URL !! Description !! Default !! Example icon | ! URL !! Description !! Default !! Example icon | ||
|- | |- | ||
− | | sheetid || It's the id of an item that you can find in the Character xml file.<br />For example, '''iczahp_3.sitem''' is a valid '''sheetid'''. || || | + | | sheetid || It's the id of an item that you can find in the Character xml file.<br />For example, '''iczahp_3.sitem''' is a valid '''sheetid'''. || || |
+ | {| | ||
+ | |- | ||
+ | | {{APIitemIcon|sheetid=iczahp_3.sitem}} | ||
+ | |- | ||
+ | | iczahp_3.sitem | ||
+ | |} | ||
+ | |- | ||
+ | | c || (optional), default is 1<br />The color of the item. It's a value between 0 and 7 || | ||
+ | {| | ||
+ | |- | ||
+ | | {{APIitemIcon|sheetid=iczahp_3.sitem|c=1}} | ||
|- | |- | ||
− | | c | | + | | c=1 |
+ | |} | ||
+ | || | ||
{| | {| | ||
|- | |- | ||
− | | | + | | {{APIitemIcon|sheetid=iczahp_3.sitem|c=0}} || {{APIitemIcon|sheetid=iczahp_3.sitem|c=1}} || {{APIitemIcon|sheetid=iczahp_3.sitem|c=2}} || {{APIitemIcon|sheetid=iczahp_3.sitem|c=3}} |
|- | |- | ||
| 0 || 1 || 2 || 3 | | 0 || 1 || 2 || 3 | ||
|- | |- | ||
− | | | + | | {{APIitemIcon|sheetid=iczahp_3.sitem|c=4}} || {{APIitemIcon|sheetid=iczahp_3.sitem|c=5}} || {{APIitemIcon|sheetid=iczahp_3.sitem|c=6}} || {{APIitemIcon|sheetid=iczahp_3.sitem|c=7}} |
|- | |- | ||
| 4 || 5 || 6 || 7 | | 4 || 5 || 6 || 7 | ||
|} | |} | ||
|- | |- | ||
− | | q || (optional), default is 0<br />The quality of the item. | + | | q || (optional), default is 0<br />The quality of the item. || |
{| | {| | ||
|- | |- | ||
− | | | + | | {{APIitemIcon|sheetid=iczahp_3.sitem|q=0}} |
|- | |- | ||
− | | 0 | + | | q=0 |
|} | |} | ||
+ | || | ||
+ | {| | ||
+ | |- | ||
+ | | {{APIitemIcon|sheetid=iczahp_3.sitem|q=0}} || {{APIitemIcon|sheetid=iczahp_3.sitem|q=120}} | ||
+ | |- | ||
+ | | 0 || 120 | ||
+ | |} | ||
+ | |- | ||
+ | | s || (optional), default is 0<br />The size of the stack. || | ||
+ | {| | ||
+ | |- | ||
+ | | {{APIitemIcon|sheetid=iczahp_3.sitem|s=0}} | ||
|- | |- | ||
− | | s | + | | s=0 |
+ | |} | ||
+ | || | ||
{| | {| | ||
|- | |- | ||
− | | | + | | {{APIitemIcon|sheetid=iczahp_3.sitem|s=0}} || {{APIitemIcon|sheetid=iczahp_3.sitem|s=53}} |
|- | |- | ||
− | | 0 || | + | | 0 || 53 |
|} | |} | ||
|- | |- |
Revision as of 08:53, 23 July 2020
Retrieves Item icons
Usage
<base URL>/item_icon.php?sheetid=iczahp_3.sitem&c=1&q=0&s=0&sap=-1&destroyed=0&label=1&locked=0
URL Parameters
URL | Description | Default | Example icon | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sheetid | It's the id of an item that you can find in the Character xml file. For example, iczahp_3.sitem is a valid sheetid. |
| |||||||||||||||||||
c | (optional), default is 1 The color of the item. It's a value between 0 and 7 |
|
| ||||||||||||||||||
q | (optional), default is 0 The quality of the item. |
|
| ||||||||||||||||||
s | (optional), default is 0 The size of the stack. |
|
| ||||||||||||||||||
sap | (optional) number of sap of the item. -1 = (default) No sap icon, no number 0 = sap icon, no number |
Example sap=-1 |
| ||||||||||||||||||
destroyed | (optional) display the item as if it was destroyed (with a red cross) 0 = (default) |
Example destroyed=0 |
| ||||||||||||||||||
label | (optional), draw icon text if present 1 = (default) |
Example label=1 |
| ||||||||||||||||||
locked | (optional) display the item as if it was locked by the owner 0 = (default) |
Example 0 = (default) |
|
Cache Duration
It's cached for ever. Since the icon is unique and never change. For a specific icon, it'll always return the same image.
PHP interface
ryzom_item_icon_url($sheetid, $c=-1, $q=0, $s=0, $sap=-1, $destroyed=false, $label=true, $locked=false)
Returns a string that contains the url to display a item icon.
<?php
require_once "ryzomapi_lite.php";
$url = ryzom_item_icon_url('iczahp_3.sitem', 2);
echo "<img src=\"{$url}\" alt=\"\">";