Exemplo n.º 1
0
        async void Frame()
        {
            byte y   = 255;
            byte x   = 0;
            var  col = new SKColor(y, y, y, x);

            while (true)
            {
                await Task.Delay(sleep);

                Scene.PrepareDraw();
                Scene.RenderContext.Canvas.Clear(SKColor.Empty);
                Scene.Draw();
                Scene.EndDraw();
                Ske.InvalidateVisual();
            }
        }
Exemplo n.º 2
0
 private void Ske_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         animator = new Animator(Ske.CanvasSize.Width, Ske.CanvasSize.Height);
         var Scene = animator.Scene;
         ImgHelper.LoadImg(Scene.TextureManager, System.IO.Path.Combine(Environment.CurrentDirectory, "snoke.png"), "snoke");
         var l = new SnokeLayout("snoke");
         Scene.Layouts.Add(l);
         Scene.RenderContext.LoadContent();
         animator.NeedToFrame += ani => Ske.InvalidateVisual();
         animator.Start();
     }
     catch (Exception ex)
     {
         Debug.Fail(ex.Message);
     }
 }