示例#1
0
        protected override void StartAnimation()
        {
            GlyphResult = new Glyph7x5(' ', new Vector2(Delta * 4, -5), SimpleShader);
            Childrens.Add(GlyphResult);

            Bits[0].Animation("Translate", new Vector2(0, -5), 500, () =>
            {
                GlyphResult.Char = Bits.Count(x => x.Char == '1') % 2 == 1 ? '1' : '0';
                GlyphResult.Animation("Translate", GlyphResult.Translate, 400, () =>
                {
                    GlyphPlus.Char  = ' ';
                    GlyphEqual.Char = ' ';
                    for (int i = 0; i < Bits.Length; i++)
                    {
                        var localI = i;
                        Bits[localI].Animation("Translate", Bits[localI].Translate, 200, () =>
                        {
                            Childrens.Remove(Bits[localI]);
                            Bits[localI] = null;
                        });
                        Bits[i].Char = ' ';
                    }
                    GlyphResult.Animation("Translate", new Vector2(Delta * 4 + 2, Delta * 2 + 2), 200, () =>
                    {
                        EndAnimation(GlyphResult, 0);
                        GlyphResult = null;
                    });
                });
            });

            for (int i = 1; i < Bits.Length; i++)
            {
                int localI = i;
                Bits[localI].Animation("Translate", new Vector2(Delta * 2, -5), 500);
            }
            GlyphPlus.Char  = '+';
            GlyphEqual.Char = '=';
        }
示例#2
0
        protected override void StartAnimation()
        {
            Bits[0].Animation("Translate", new Vector2(Delta, Delta), 100, () =>
            {
                CloneBit = new Glyph7x5(Bits[0].Char, Bits[0].Translate, SimpleShader);
                CloneBit.InstasingList[0].Color = Color4.Black;
                Childrens.Add(CloneBit);
                Bits[0].Animation("Translate", OutputConnectors[0].Translate, 100, () =>
                {
                    EndAnimation(Bits[0], 0);
                    Bits[0] = null;
                });

                CloneBit.Animation("Translate", OutputConnectors[1].Translate, 100, () =>
                {
                    EndAnimation(CloneBit, 1);
                    CloneBit = null;
                });
            });
        }