public DrawTexture(Texture2D texture, string frameName, ImageSourcePosition position = ImageSourcePosition.LeftTop) : this(texture, position) { var textureKey = texture.Name; var frame = ImagesManager.GetFrame(textureKey, frameName); if (frame != null) { Source = new Rectangle(frame.Left, frame.Top, frame.Width, frame.Height); } }
public static ActorAnimation Get(string textureName, string animation, int frames, bool continuous = true) { var anName = textureName + animation; if (animations.ContainsKey(anName)) { return(animations[anName]); } else { var anEntity = new ActorAnimation(animation, frames, ImagesManager.GetTexture(textureName), continuous); animations.Add(anName, anEntity); return(anEntity); } }