Difference between revisions of "Ryzom API/Item icon"

From EncyclopAtys

Jump to: navigation, search
(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...")
 
 
(10 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 9: Line 9:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! URL !! 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'''.  || || icon<br />Example
+
| 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] || ||  
 +
{|
 +
|-
 +
| {{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 || (optional), default is 1<br />The color of the item. It's a value between 0 and 7 || c=1 ||  
+
| c=1
 +
|}
 +
  ||  
 
{|
 
{|
 
|-
 
|-
| Example || Example || Example || Example
+
| {{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
 
|-
 
|-
| Example || Example || Example || Example
+
| {{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. || Example<br />q=0 ||  
+
| q || (optional), default is 0<br />The quality of the item. ||  
 +
{|
 +
|-
 +
| {{APIitemIcon|sheetid=iczahp_3.sitem|q=0}}
 +
|-
 +
| q=0
 +
|}
 +
||  
 
{|
 
{|
 
|-
 
|-
| Example || Example
+
| {{APIitemIcon|sheetid=iczahp_3.sitem|q=0}} || {{APIitemIcon|sheetid=iczahp_3.sitem|q=120}}
 
|-
 
|-
| 0 || 10
+
| 0 || 120
 
|}
 
|}
 
|-
 
|-
| s || (optional), default is 0<br />The size of the stack. || Examples=0 ||  
+
| s || (optional), default is 0<br />The size of the stack. ||  
 +
{|
 +
|-
 +
| {{APIitemIcon|sheetid=iczahp_3.sitem|s=0}}
 +
|-
 +
| s=0
 +
|}
 +
||  
 
{|
 
{|
 
|-
 
|-
| Example || Example
+
| {{APIitemIcon|sheetid=iczahp_3.sitem|s=0}} || {{APIitemIcon|sheetid=iczahp_3.sitem|s=53}}
 
|-
 
|-
| 0 || 10
+
| 0 || 53
 
|}
 
|}
 
|-
 
|-
| sap || (optional) number of sap of the item.<br />-1 = (default) No sap icon, no number<br />0 = sap icon, no number || Example<br />sap=-1 ||  
+
| sap || (optional) number of sap ''plus 1'' of the item.<br />-1 = (default) No sap icon, no number<br />0 = sap icon, no number ||  
 
{|
 
{|
 
|-
 
|-
| Example || Example || Example || Example || Example
+
| {{APIitemIcon|sheetid=icfm2ms_3.sitem|q=100|s=1|sap=-1}}
 
|-
 
|-
| -1 || 0 || 1 || 2 || 3
+
| sap=-1
 
|}
 
|}
 +
||
 +
{|
 
|-
 
|-
| destroyed || (optional) display the item as if it was destroyed (with a red cross)<br />0 = (default) || Example<br />destroyed=0 ||  
+
| {{APIitemIcon|sheetid=icfm2ms_3.sitem|q=100|s=1|sap=-1}} || {{APIitemIcon|sheetid=icfm2ms_3.sitem|q=100|s=1|sap=0}} || {{APIitemIcon|sheetid=icfm2ms_3.sitem|q=100|s=1|sap=1}} || {{APIitemIcon|sheetid=icfm2ms_3.sitem|q=100|s=1|sap=2}} || {{APIitemIcon|sheetid=icfm2ms_3.sitem|q=100|s=1|sap=8}}
 +
|-
 +
| -1 || 0 || 1 || 2 || 8
 +
|}
 +
|-
 +
| destroyed || (optional) displays the item as if it was destroyed (with a red cross)<br />0 = (default) ||  
 +
{|
 +
|-
 +
| {{APIitemIcon|sheetid=iczahp_3.sitem| destroyed=0}}
 +
|-
 +
| destroyed=0
 +
|}
 +
||  
 
{|
 
{|
 
|-
 
|-
| Example || Example
+
| {{APIitemIcon|sheetid=iczahp_3.sitem| destroyed=0}} || {{APIitemIcon|sheetid=iczahp_3.sitem| destroyed=1}}
 
|-
 
|-
 
| 0 || 1
 
| 0 || 1
 
|}
 
|}
 
|-
 
|-
| label || (optional), draw icon text if present<br />1 = (default) || Example<br />label=1 ||  
+
| label || (optional), draws icon text if present<br />1 = (default) ||  
 
{|
 
{|
 
|-
 
|-
| Example || Example
+
| {{APIitemIcon|sheetid=m0021dxapd01.sitem| label=1}}
 +
|-
 +
| label=1
 +
|}
 +
||
 +
{|
 +
|-
 +
| {{APIitemIcon|sheetid=m0021dxapd01.sitem|label=0}} || {{APIitemIcon|sheetid=m0021dxapd01.sitem|label=1}}
 
|-
 
|-
 
| 0 || 1
 
| 0 || 1
 
|}
 
|}
 
|-
 
|-
| locked || (optional) display the item as if it was locked by the owner<br />0 = (default) || Example<br />0 = (default) ||  
+
| locked || (optional) display the item as if it was locked by the owner<br />0 = (default) ||  
 +
{|
 +
|-
 +
| {{APIitemIcon|sheetid=iczahp_3.sitem|locked=0}}
 +
|-
 +
| locked=0
 +
|}
 +
||  
 
{|
 
{|
 
|-
 
|-
| Example || Example
+
| {{APIitemIcon|sheetid=iczahp_3.sitem|locked=0}} || {{APIitemIcon|sheetid=iczahp_3.sitem|locked=1}}
 
|-
 
|-
 
| 0 || 1
 
| 0 || 1

Latest revision as of 13:52, 27 May 2023

de:Ryzom API/Gegenstands-Symbol en:Ryzom API/Item icon
 
UnderConstruction.png
Translation to review
Don't blame the contributors, but come and help them 😎

Reference text ( Maintained text, used as reference ) :
Notes: (Leda, 2023-05-27)

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
iczahp_3.sitem
c (optional), default is 1
The color of the item. It's a value between 0 and 7
c=1
0 1 2 3
4 5 6 7
q (optional), default is 0
The quality of the item.
q=0
0 120
s (optional), default is 0
The size of the stack.
s=0
0 53
sap (optional) number of sap plus 1 of the item.
-1 = (default) No sap icon, no number
0 = sap icon, no number
sap=-1
-1 0 1 2 8
destroyed (optional) displays the item as if it was destroyed (with a red cross)
0 = (default)
destroyed=0
0 1
label (optional), draws icon text if present
1 = (default)
label=1
0 1
locked (optional) display the item as if it was locked by the owner
0 = (default)
locked=0
0 1

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=\"\">";