Difference between revisions of "Ryzom API/Item icon"
From EncyclopAtys
(→Usage) |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | <noinclude>__TOC__</noinclude> | + | <noinclude>{{Trad|DE=Ryzom API/Gegenstands-Symbol|EN=Ryzom API/Item icon|palette=api|H=1}}__TOC__</noinclude> |
− | Retrieves Item icons | + | Retrieves Item icons (see also: [[Ryzom API/Item sheetids]]) |
=== Usage === | === Usage === | ||
Line 11: | Line 11: | ||
! Parameter !! Description !! Default !! Example icon | ! Parameter !! 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'''. <br /> [[{{ | + | | 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'''. <br /> [[{{BASEPAGENAME}}#Third party libraries|sheetids]] can me found in [https://github.com/nimetu/ryzom_extra Nimetu's ryzom_extra repository] || || |
{| | {| | ||
|- | |- |
Latest revision as of 12:52, 27 May 2023
Retrieves Item icons (see also: Ryzom API/Item sheetids)
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
Parameter | 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. sheetids can me found in Nimetu's ryzom_extra repository |
| |||||||||||||||||||
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 plus 1 of the item. -1 = (default) No sap icon, no number 0 = sap icon, no number |
|
| ||||||||||||||||||
destroyed | (optional) displays the item as if it was destroyed (with a red cross) 0 = (default) |
|
| ||||||||||||||||||
label | (optional), draws icon text if present 1 = (default) |
|
| ||||||||||||||||||
locked | (optional) display the item as if it was locked by the owner 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=\"\">";