//protected void DrawHistory() //{ // for (int i = 0; i < CurrentAnimationIndex; i++) // { // var animation = Animations[i]; // if (animation is AnimationMove) // { // AnimationMove ato = (animation as AnimationMove); // if (ato.Path.IsDraw) // { // Graphics.DrawLine(ato.Path.FromPosition, ato.Path.ToPosition, ato.Pen.Size, ato.Pen.Color); // } // } // } //} public virtual void Draw() { for (int i = 0; i <= CurrentAnimationIndex; i++) { ZLogoActionBase act = Animations[i]; act.Draw(); } //DrawHistory(); ////ShowSceneImage(); //IAnimation2D currentAnimation2D = GetCurrentAnimation(); //if (currentAnimation2D != null && currentAnimation2D is AnimationMove) //{ // AnimationMove ato = (currentAnimation2D as AnimationMove); // if (ato.Path.IsDraw) // { // Graphics.DrawLine(ato.Path.FromPosition, ato.Sprite.Positon, ato.Pen.Size, ato.Pen.Color); // } // //Vector2Ex lastPoint = spritePather.Top; // //if(lastPoint.IsDraw) // // Graphics.DrawLine(lastPoint.Point, this.Positon, Pen.Size, Pen.Color); //} //if (currentAnimation2D != null) //{ // Graphics.DrawTexture(this.Texture, currentAnimation2D.Sprite.Positon, currentAnimation2D.Sprite.Angle); //} //else //{ // Graphics.DrawTexture(this.Texture, this.Positon, this.Angle); //} //i++; //sceneImage = Graphics.GetSceneImage(); //DrawTexture(); }
public virtual void Update() { ZLogoActionBase currentAnimation2D = GetCurrentAnimation(); if (currentAnimation2D != null) { if (currentAnimation2D.State != ActionExecState.End) { currentAnimation2D.RunAction(); } if (currentAnimation2D.State == ActionExecState.End) { if (CurrentAnimationIndex < Animations.Count - 1) { CurrentAnimationIndex++; } } } }
//public TurtleSprite(TurtleForm form) //{ // Form = form; // this.Painter = new Draw2D(form.Width, form.Height); // StartAction = new TurtleStart(Painter); // AddAction(StartAction); //} public void AddAction(ZLogoActionBase turtleActionBase) { Animations.Add(turtleActionBase); CurrentAction = turtleActionBase; }