Exemplo n.º 1
0
        public static FrameAnimationData CreateFromNode(Wz_Node node, GraphicsDevice graphicsDevice, GlobalFindNodeFunction findNode)
        {
            if (node == null)
            {
                return(null);
            }
            var anime = new FrameAnimationData();

            for (int i = 0; ; i++)
            {
                Wz_Node frameNode = node.FindNodeByPath(i.ToString());

                if (frameNode == null || frameNode.Value == null)
                {
                    break;
                }
                Frame frame = Frame.CreateFromNode(frameNode, graphicsDevice, findNode);

                if (frame == null)
                {
                    break;
                }
                anime.Frames.Add(frame);
            }
            if (anime.Frames.Count > 0)
            {
                return(anime);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        public void ShowImage(Wz_Png png)
        {
            //添加到动画控件
            var frame = new Animation.Frame()
            {
                Texture = png.ToTexture(this.GraphicsDevice),
                Png     = png,
                Delay   = 0,
                Origin  = Point.Zero,
            };

            var frameData = new Animation.FrameAnimationData();

            frameData.Frames.Add(frame);

            this.ShowAnimation(frameData);
        }
Exemplo n.º 3
0
 public FrameAnimator(FrameAnimationData data)
 {
     this.Data = data;
     this.Load();
 }