Methods
# getItem(fileName, callback) → {Asset.Item|undefined}
Gets the item object and returns it to the caller
Parameters:
Name | Type | Description |
---|---|---|
fileName |
string | The relative path to the item. |
callback |
Callback | Invoked when the item has finished loading. |
Item object or undefined if none available.
Asset.Item
|
undefined
Example
rpgcode.getItem("apple.item", function(item) {
rpgcode.log(item);
});
# giveItem(filename, characterId, callback)
Gives an item to a character, placing in their inventory.
Parameters:
Name | Type | Description |
---|---|---|
filename |
string | |
characterId |
string | |
callback |
Callback | Invoked when the item has finished loading assets. |
# takeItem(filename, characterId)
Takes the item from the character's inventory.
Parameters:
Name | Type | Description |
---|---|---|
filename |
string | The filename of the item. |
characterId |
string | The character to remove it from. |