Class TimbnPluginSprites
Adds custom sprites on behalf of a plugin, such as icons for its items and buffs. The game finds sprites by name, so a sprite added here shows anywhere its name is used as an icon id. Sprites are removed and their textures freed when the plugin unloads. Reach it through the plugin's Sprites property.
public sealed class TimbnPluginSprites
- Inheritance
-
TimbnPluginSprites
- Inherited Members
Methods
AddEmbeddedPng(string)
Adds a PNG embedded in the plugin's DLL, like AddPng(string, byte[]). The resource is found by the sprite name
plus ".png", so embed icons with LogicalName="%(Filename)%(Extension)".
public IDisposable AddEmbeddedPng(string name)
Parameters
namestringThe sprite name and the resource's name without ".png", for example "timbn_smoked_fish".
Returns
- IDisposable
A handle that removes the sprite early when disposed. You don't need to keep it.
Exceptions
- InvalidOperationException
The plugin has no such embedded resource.
AddPng(string, byte[])
Adds a PNG under a sprite name. An image smaller than 48 pixels (the size of the game's icons) is centered on a 48 pixel canvas. Sprites use point filtering and 50 pixels per unit, like the game's own art.
public IDisposable AddPng(string name, byte[] png)
Parameters
namestringThe sprite name, used as an item's or buff's IconId.
pngbyte[]The PNG file's bytes, usually read from a resource embedded in the plugin's DLL.
Returns
- IDisposable
A handle that removes the sprite early when disposed. You don't need to keep it.