tk2dSpriteCollectionData.GetSpriteIdByName C# (CSharp) Method

GetSpriteIdByName() public method

Resolves a sprite name and returns a unique id for the sprite.
public GetSpriteIdByName ( string name ) : int
name string Case sensitive sprite name, as defined in the sprite collection. This is usually the source filename excluding the extension
return int
    public int GetSpriteIdByName(string name)
    {
        inst.InitDictionary();
        int returnValue = 0;
        inst.spriteNameLookupDict.TryGetValue(name, out returnValue);
        return returnValue; // default to first sprite
    }

Usage Example

Ejemplo n.º 1
0
        public static void Notify(string header, string text, string spriteID, UINotificationController.NotificationColor color = UINotificationController.NotificationColor.SILVER)
        {
            tk2dSpriteCollectionData encounterIconCollection = AmmonomiconController.Instance.EncounterIconCollection;
            int spriteIdByName = encounterIconCollection.GetSpriteIdByName(spriteID);

            GameUIRoot.Instance.notificationController.DoCustomNotification(header, text, encounterIconCollection, spriteIdByName, color, false, false);
        }
All Usage Examples Of tk2dSpriteCollectionData::GetSpriteIdByName