Example #1
0
        public WithCrumbleOverlay(Actor self, WithCrumbleOverlayInfo info)
        {
            var rs = self.Trait <RenderSprites>();

            overlay = new Animation(rs.GetImage(self));
            overlay.PlayThen(info.Sequence, () => buildComplete = false);
            rs.anims.Add("make_overlay_{0}".F(info.Sequence),
                         new AnimationWithOffset(overlay, null, () => !buildComplete, null));
        }
Example #2
0
        public WithCrumbleOverlay(ActorInitializer init, WithCrumbleOverlayInfo info)
        {
            var rs = init.self.Trait <RenderSprites>();

            if (!init.Contains <SkipMakeAnimsInit>())
            {
                var overlay = new Animation(rs.GetImage(init.self));
                overlay.PlayThen(info.Sequence, () => buildComplete = false);
                rs.anims.Add("make_overlay_{0}".F(info.Sequence),
                             new AnimationWithOffset(overlay, null, () => !buildComplete, null));
            }
        }
        public WithCrumbleOverlay(ActorInitializer init, WithCrumbleOverlayInfo info)
        {
            if (init.Contains <SkipMakeAnimsInit>())
            {
                return;
            }

            var key = "make_overlay_{0}".F(info.Sequence);
            var rs  = init.self.Trait <RenderSprites>();

            var overlay = new Animation(init.world, rs.GetImage(init.self));

            // Remove the animation once it is complete
            overlay.PlayThen(info.Sequence, () => init.world.AddFrameEndTask(w => rs.Remove(key)));

            rs.Add(key, new AnimationWithOffset(overlay, null, () => !buildComplete),
                   info.Palette, info.IsPlayerPalette);
        }