Interface IInventoryFactory
A factory for creating inventory items and inventory windows.
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
public interface IInventoryFactory
Methods
| Improve this Doc View SourceGetInventoryItem(IObject, IObject, Boolean)
Creates a new inventory item.
Declaration
IInventoryItem GetInventoryItem(IObject graphics, IObject cursorGraphics, bool playerStartsWithItem = false)
Parameters
Type | Name | Description |
---|---|---|
IObject | graphics | Graphics object for the item. |
IObject | cursorGraphics | When the item is selected for using on other objects, the cursor will be using this graphics . |
System.Boolean | playerStartsWithItem | If set to |
Returns
Type | Description |
---|---|
IInventoryItem | The inventory item. |
GetInventoryItem(String, String, String, ILoadImageConfig, Boolean)
Creates a new inventory item
Declaration
IInventoryItem GetInventoryItem(string hotspot, string graphicsFile, string cursorFile = null, ILoadImageConfig loadConfig = null, bool playerStartsWithItem = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | hotspot | The hotspot text (which will be shown when hovering the item if a hotspot label is in the game). |
System.String | graphicsFile | Graphics file to load the item graphics file. |
System.String | cursorFile | Cursor file to load the graphics for the cursor when the item is selected. |
ILoadImageConfig | loadConfig | A load configuration for the images. |
System.Boolean | playerStartsWithItem | If set to |
Returns
Type | Description |
---|---|
IInventoryItem | The inventory item. |
GetInventoryItemAsync(String, String, String, ILoadImageConfig, Boolean)
Creates a new inventory item asynchronously
Declaration
Task<IInventoryItem> GetInventoryItemAsync(string hotspot, string graphicsFile, string cursorFile = null, ILoadImageConfig loadConfig = null, bool playerStartsWithItem = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | hotspot | The hotspot text (which will be shown when hovering the item if a hotspot label is in the game). |
System.String | graphicsFile | Graphics file to load the item graphics file. |
System.String | cursorFile | Cursor file to load the graphics for the cursor when the item is selected. |
ILoadImageConfig | loadConfig | A load configuration for the images. |
System.Boolean | playerStartsWithItem | If set to |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IInventoryItem> | The inventory item. |
GetInventoryWindow(String, IImage, Single, Single, IInventory)
Creates a new inventory window
Declaration
IInventoryWindow GetInventoryWindow(string id, IImage image, float itemWidth, float itemHeight, IInventory inventory)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | A unique identifier for the window. |
IImage | image | A background image for the inventory window. |
System.Single | itemWidth | The width which will be allocated for each inventory item. |
System.Single | itemHeight | The height which will be allocated for each inventory item. |
IInventory | inventory | The inventory that the window will show on screen (usually the player's inventory). |
Returns
Type | Description |
---|---|
IInventoryWindow | The inventory window. |
GetInventoryWindow(String, Single, Single, Single, Single, Single, Single, IInventory, Boolean)
Creates a new inventory window
Declaration
IInventoryWindow GetInventoryWindow(string id, float width, float height, float itemWidth, float itemHeight, float x, float y, IInventory inventory = null, bool addToUi = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | A unique identifier for the window. |
System.Single | width | The width of the window. |
System.Single | height | The height of the window. |
System.Single | itemWidth | The width which will be allocated for each inventory item. |
System.Single | itemHeight | The height which will be allocated for each inventory item. |
System.Single | x | The x coordinate for the inventory window. |
System.Single | y | The y coordinate for the inventory window. |
IInventory | inventory | The inventory that the window will show on screen (usually the player's inventory). |
System.Boolean | addToUi | If set to |
Returns
Type | Description |
---|---|
IInventoryWindow | The inventory window. |