Exemplo n.º 1
0
    public Sprite getSpriteFromAnimation(string name, int frame = -1)
    {
        AnimationDefinition anim     = getAnimationByName(name);
        ImageDefinition     imageDef = GetImageByName(anim.getCurrentSubimage());

        //By default, frame is -1, which is interpreted as "current". If it's above zero, we'll get that image
        //Note that this won't set the current frame
        if (frame >= 0)
        {
            imageDef = GetImageByName(anim.getImageForFrame(frame));
        }
        return(imageDef.getSprite(fullSpriteDirectoryName, costumeName));
    }
Exemplo n.º 2
0
 /// <summary>
 /// Get the current subimage of the current animation
 /// </summary>
 /// <returns></returns>
 public ImageDefinition getCurrentSubimage()
 {
     return(sprite_info?.GetImageByName(currentAnimation.getCurrentSubimage(false)));
 }