Ejemplo n.º 1
0
        /// <summary>
        /// All parameters.
        /// </summary>
        public ManagedSprite(Sprite targetSprite, Point pos, string animationId = "", int startIndex = 0, float animationSpeed = 1f, int depth = 0)
        {
            TargetSprite = targetSprite;
            AnimationId = animationId;
            AnimationIndex = startIndex;
            AnimationSpeed = animationSpeed;
            Depth = depth;

            Position = pos;
            Size = TargetSprite.FrameSize;

            //Add to resources for updates. Weak so it will be removed when no longer used by user.
            Resources.ManagedSprites.Add(new WeakReference(this));
        }
Ejemplo n.º 2
0
 public static void Draw(Sprite sprite, Point pos, int frameIndex = 0, float rotation = 0f, int depth = 0)
 {
     sprite.Draw(pos, frameIndex, rotation, depth);
 }