Пример #1
0
        public SurfaceWindow()
        {
            InitializeComponent();
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);

            this.ClientSize = Properties.Resources.background.Size;
            PinToBackground();
            renderer = new Renderer(this);

            /* ** Create Scenes ** */

            // Background
            var background = new c.Image(renderer);

            background.SetSource(Properties.Resources.background);

            renderer.AddScene(background);

            // FPS
#if DEBUG
            renderer.AddScene(new c.FPSScene(renderer));
#endif

            // Leaf
            var lm = new LeafManager(renderer);
            lm.Size     = new SharpDX.Size2(this.ClientSize.Width, this.ClientSize.Height);
            lm.Interval = TimeSpan.FromMilliseconds(0);

            /*
             * lm.Sources.AddRange(
             *  new Bitmap[]
             *  {
             *      Properties.Resources.leaf_1,
             *      Properties.Resources.leaf_2,
             *      Properties.Resources.leaf_3,
             *      Properties.Resources.leaf_4,
             *      Properties.Resources.leaf_5
             *  });
             *
             * renderer.AddScene(lm);
             * lm.Begin();
             */
            // Morph
            var f  = new Font("맑은고딕", 128, FontStyle.Bold);
            var mm = new MorphingManager(renderer);
            mm.AddMorphing(
                CharacterFactory.ToBitmap("御坂", f.Clone() as Font),
                CharacterFactory.ToBitmap("美琴", f.Clone() as Font));

            renderer.AddScene(mm);
            mm.Begin();
        }
        public void AddMorphing(Bitmap src1, Bitmap src2)
        {
            var mc = new MorphChain(Renderer, new MorphData(src1), new MorphData(src2));

            chains.Add(mc);
            Renderer.AddScene(mc);
        }