Пример #1
0
        public void AddAnimation(string name, string texture)
        {
            AnimatedTexture tex = TextureManager.GetAnimation(texture);

            if (tex == null)
            {
                Debug.PrintError("Could not find texture: ", texture);
                return;
            }
            textures.Add(name, tex as AnimatedTexture);
        }
Пример #2
0
 public void PlayAnimation(string name, float rate)
 {
     if (!textures.ContainsKey(name))
     {
         Debug.PrintError("Could not find animation: ", name);
         return;
     }
     current     = textures[name];
     currentName = name;
     speed       = rate;
     frame       = 0;
     origin      = current.Origin();
 }
Пример #3
0
 public CAnimatedSprite() : base()
 {
     textures    = new Dictionary <string, AnimatedTexture>();
     current     = null;
     currentName = "";
 }