Sprite dB: Difference between revisions

From Intrigues Wiki
No edit summary
No edit summary
Line 49: Line 49:
</syntaxhighlight>
</syntaxhighlight>


=== GetAsset (returns one result): ===
=== GetAsset (returns first result): ===
<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">
var portrait = IM.GetAsset("Portraits", "Female", "Imperian");
var portrait = IM.GetAsset("Portraits", "Female", "Imperian");
</syntaxhighlight>Use SpriteDb to create a structured, taggable asset pool for all your dynamic portrait, faction, and context-based sprite needs.
</syntaxhighlight>Use SpriteDb to create a structured, taggable asset pool for all your dynamic portrait, faction, and context-based sprite needs.

Revision as of 13:26, 29 May 2025

🖼️ Sprite Database (SpriteDb)

The SpriteDb window allows you to organize, tag, and categorize sprites visually for use with Intrigues.

Sprite dB

Use it to define visual assets like character portraits, icons, and UI elements grouped by logic or theme.


📂 Categories

Sprites are grouped under Categories. You can create new categories via the New Category input at the top.

To add sprites to a category:

  • Simply drag and drop Sprite assets from the Project window onto the desired category section.

🏷️ Tags

Each sprite can be assigned Tags to help with sorting, filtering, and runtime querying.

To add a tag:

  • Right-click a sprite → select Add Tag

To assign an existing tag:

  • Drag the tag onto one or multiple selected sprites
  • Use Shift + Click or Ctrl + Click to make multi-selection

To hide tags:

  • Hold Ctrl → tag labels will toggle visibility

🖱️ Selection Controls

  • Shift + Left Click → Multi-select range
  • Ctrl + Left Click → Multi-select individual

🔍 Search

Use the search bar to quickly filter sprites by name or tag.


🧠 Usage in Runtime

You can retrieve sprites at runtime via:

GetAssets (returns a list):

var portraits = IM.GetAssets("Portraits", "Male", "Northlander");

GetAsset (returns first result):

var portrait = IM.GetAsset("Portraits", "Female", "Imperian");

Use SpriteDb to create a structured, taggable asset pool for all your dynamic portrait, faction, and context-based sprite needs.