Class AssetManagerUtil
Helper class with some methods for work with IAssetManager2D class
Inherited Members
Namespace:
Assembly: .dll
Syntax
public final class AssetManagerUtil
Constructors
AssetManagerUtil()
Declaration
public AssetManagerUtil()
Methods
<T>tryGetPixelTextureWithSize(IAssetManager2D assetManager, ResourceId resourceId, int width, int height, TextureFiltering textureFiltering, Class<T> textureType)
Tries to get texture from assetManager with specified size
Declaration
public static T <T>tryGetPixelTextureWithSize(IAssetManager2D assetManager, ResourceId resourceId, int width, int height, TextureFiltering textureFiltering, Class<T> textureType)
Parameters
| Type | Name | Description |
|---|---|---|
| IAssetManager2D | assetManager | The asset manager to use |
| ResourceId | resourceId | The resource id |
| int | width | The width of texture |
| int | height | The height of texture |
| TextureFiltering | textureFiltering | The sampling mode |
| Class<T> | textureType |
Returns
| Type | Description |
|---|---|
| T | Returns the texture if it satisfies the size and type constraint, otherwise returns null |
<T>tryGetTextureWithSize(IAssetManager2D assetManager, ResourceId resourceId, int width, int height, Class<T> textureType)
Tries to get texture from assetManager with specified size
Declaration
public static T <T>tryGetTextureWithSize(IAssetManager2D assetManager, ResourceId resourceId, int width, int height, Class<T> textureType)
Parameters
| Type | Name | Description |
|---|---|---|
| IAssetManager2D | assetManager | The asset manager to use |
| ResourceId | resourceId | The resource id |
| int | width | The width of texture |
| int | height | The height of texture |
| Class<T> | textureType |
Returns
| Type | Description |
|---|---|
| T | Returns the texture if it satisfies the size and type constraint, otherwise returns null |
<TResource>tryGetResource(IAssetManager2D assetManager, ResourceId resourceId, Class<TResource> resourceType)
Gets resource from assetManager and tries to cast it to specified resourceType
Declaration
public static TResource <TResource>tryGetResource(IAssetManager2D assetManager, ResourceId resourceId, Class<TResource> resourceType)
Parameters
| Type | Name | Description |
|---|---|---|
| IAssetManager2D | assetManager | The asset manager to use |
| ResourceId | resourceId | The resource id |
| Class<TResource> | resourceType | The resource type |
Returns
| Type | Description |
|---|---|
| TResource | Returns casted resource if it possible and if cast isn't possible then returns null |