Пример #1
0
 public OsbAnimationPool(StoryboardLayer layer, string path, int frameCount, double frameDelay, OsbLoopType loopType, OsbOrigin origin, Action <OsbSprite, double, double> finalizeSprite = null)
     : base(layer, path, origin, finalizeSprite)
 {
     this.frameCount = frameCount;
     this.frameDelay = frameDelay;
     this.loopType   = loopType;
 }
Пример #2
0
 public abstract OsbAnimation CreateAnimation(string path, int frameCount, double frameDelay, OsbLoopType loopType, OsbOrigin origin = OsbOrigin.Centre);
Пример #3
0
 public abstract OsbAnimation CreateAnimation(string path, int frameCount, double frameDelay, OsbLoopType loopType, OsbOrigin origin, Vector2 initialPosition);
Пример #4
0
 public override OsbAnimation CreateAnimation(string path, int frameCount, double frameDelay, OsbLoopType loopType, OsbOrigin origin = OsbOrigin.Centre)
 => CreateAnimation(path, frameCount, frameDelay, loopType, origin, OsbSprite.DefaultPosition);
Пример #5
0
        public override OsbAnimation CreateAnimation(string path, int frameCount, double frameDelay, OsbLoopType loopType, OsbOrigin origin, Vector2 initialPosition)
        {
            var storyboardObject = new EditorOsbAnimation()
            {
                TexturePath     = path,
                Origin          = origin,
                FrameCount      = frameCount,
                FrameDelay      = frameDelay,
                LoopType        = loopType,
                InitialPosition = initialPosition,
            };

            storyboardObjects.Add(storyboardObject);
            displayableObjects.Add(storyboardObject);
            return(storyboardObject);
        }
Пример #6
0
 private string getKey(string path, int frameCount, double frameDelay, OsbLoopType loopType, OsbOrigin origin, Action <OsbSprite, double, double> action, int poolGroup)
 => $"{path}#{frameCount}#{frameDelay}#{loopType}#{origin}#{action?.Target}.{action?.Method.Name}#{poolGroup}";
Пример #7
0
        private OsbAnimationPool getPool(string path, int frameCount, double frameDelay, OsbLoopType loopType, OsbOrigin origin, Action <OsbSprite, double, double> finalizeSprite, int poolGroup)
        {
            var key = getKey(path, frameCount, frameDelay, loopType, origin, finalizeSprite, poolGroup);

            if (!animationPools.TryGetValue(key, out OsbAnimationPool pool))
            {
                animationPools.Add(key, pool = new OsbAnimationPool(layer, path, frameCount, frameDelay, loopType, origin, finalizeSprite)
                {
                    MaxPoolDuration = maxPoolDuration,
                });
            }

            return(pool);
        }
Пример #8
0
 public OsbAnimation Get(double startTime, double endTime, string path, int frameCount, double frameDelay, OsbLoopType loopType, OsbOrigin origin, bool additive, int poolGroup = 0)
 => Get(startTime, endTime, path, frameCount, frameDelay, loopType, origin, additive ? (sprite, spriteStartTime, spriteEndTime) => sprite.Additive(spriteStartTime, spriteEndTime) : (Action <OsbSprite, double, double>)null, poolGroup);
Пример #9
0
 public OsbAnimation Get(double startTime, double endTime, string path, int frameCount, double frameDelay, OsbLoopType loopType, OsbOrigin origin = OsbOrigin.Centre, Action <OsbSprite, double, double> finalizeSprite = null, int poolGroup = 0)
 => (OsbAnimation)getPool(path, frameCount, frameDelay, loopType, origin, finalizeSprite, poolGroup).Get(startTime, endTime);
Пример #10
0
 public OsbAnimationPool(StoryboardLayer layer, string path, int frameCount, double frameDelay, OsbLoopType loopType, OsbOrigin origin, bool additive)
     : this(layer, path, frameCount, frameDelay, loopType, origin, additive ? (sprite, startTime, endTime) => sprite.Additive(startTime, endTime) : (Action <OsbSprite, double, double>)null)
 {
 }