AddIconToken

From King Arthur's Gold Wiki
Revision as of 14:11, 15 August 2012 by Shadlington (Talk | contribs)

Jump to: navigation, search

This defines an token (e.g. $EmptyShop$) for icon replacement in menus and suchlike.


There are two variants, one of which will also accept a color (SColor).

void AddIconMarker( const string &marker, const string &texture, dimension2di frameDimension, int frame, [[SColor]] color )

Example from Entities/Characters/Scripts/BuilderInventory.as:

void [[onInit]]( [[CInventory]]@ this )
{
  AddIconMarker( "$EmptyShop$", "Entities/Workshops/Sprites/WorkshopIcons.png", dimension2di(16,16), 0 );
}

This icon marker means that whenever $EmptyShop$ is included in menu text, the first frame of the WorkshopIcons.png spritesheet will be substituted in.