/// <summary> /// 更新処理 /// </summary> public void Update() { if (IsProcessingEvent && ProcessingAnimation.AnimationFrame > 0) { X += ProcessingAnimation.IncrementX; Y += ProcessingAnimation.IncrementY; Width += ProcessingAnimation.IncrementWidth; Height += ProcessingAnimation.IncrementHeight; ProcessingAnimation.AnimationFrame--; } else if (IsProcessingEvent && ProcessingAnimation.AnimationFrame == 0) { X = ProcessingAnimation.TargetX; Y = ProcessingAnimation.TargetY; Width = ProcessingAnimation.TargetWidth; Height = ProcessingAnimation.TargetHeight; ProcessingAnimation.AnimationFrame = 0; IsProcessingEvent = false; } if (!IsProcessingEvent && AnimationSchedule.Count != 0 && !IsStopped) { ProcessingAnimation = AnimationSchedule.Dequeue(); IsProcessingEvent = true; } }
/// <summary> /// デフォルトコンストラクタ /// </summary> /// <param name="textureHandle">テクスチャの識別子</param> /// <param name="x">テクスチャの左上のX座標</param> /// <param name="y">テクスチャの左上のy座標</param> /// <param name="width">テクスチャの幅</param> /// <param name="height">テクスチャの高さ</param> public AnimationTexture(int textureHandle, double x, double y, double width, double height) { TextureHandle = textureHandle; X = x; Y = y; Width = width; Height = height; IsProcessingEvent = false; IsStopped = true; AnimationSchedule = new ListQueue <SugorokuAnimation>(); ProcessingAnimation = new SugorokuAnimation(0, x, y, width, height, 0, 0, 0, 0, 0); }