コード例 #1
0
        /// <summary>
        /// Set Animation
        /// </summary>
        /// <param name="gameTime">XNA GameTime Reference</param>
        /// <param name="dir">Direction Enumeration</param>
        public void SetAnimation(GameTime gameTime, Enumeration.EDirection dir)
        {
            if (dir == Enumeration.EDirection.Next)
            {
                this.current_animation += this.animationpersecond * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }
            if (dir == Enumeration.EDirection.Previous)
            {
                this.current_animation -= this.animationpersecond * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }

            if (this.islooped)
            {
                if (dir == Enumeration.EDirection.Next)
                {
                    this.current_animation %= this.totalRows + 1;
                }
                else
                {
                    if (this.current_animation < 0)
                    {
                        this.current_animation = this.totalRows + 1;
                    }
                }
            }

            this.SetSourceImage((int)current_animation, (int)current_frame);
        }
コード例 #2
0
        /// <summary>
        /// Set Frame
        /// </summary>
        /// <param name="gameTime">XNA GameTime Reference</param>
        /// <param name="dir">Direction Enumeration</param>
        public void SetFrame(GameTime gameTime, Enumeration.EDirection dir)
        {
            if (dir == Enumeration.EDirection.Next)
            {
                this.current_frame += this.framespersecond * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }
            if (dir == Enumeration.EDirection.Previous)
            {
                this.current_frame -= this.framespersecond * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }

            if (this.islooped)
            {
                if (dir == Enumeration.EDirection.Next)
                {
                    this.current_frame %= this.totalColumns + 1;
                }
                else
                {
                    if (this.current_frame < 0)
                    {
                        this.current_frame = this.totalColumns + 1;
                    }
                }
            }

            this.SetSourceImage((int)current_animation, (int)current_frame);
        }
コード例 #3
0
 /// <summary>
 /// Initialize The Effect
 /// </summary>
 /// <param name="Type">Line Type</param>
 /// <param name="Size">Image Size</param>
 /// <param name="direction">Effect Direction</param>
 public void Initialize(Enumeration.ELine Type, float Size, Enumeration.EDirection direction)
 {
     if (Type == Chimera.Graphics.Enumeration.ELine.Horizontal)
     {
         hiding.Initialize(new Vector2(graphics.GraphicsDevice.Viewport.Width, Size), direction);
     }
     else if (Type == Chimera.Graphics.Enumeration.ELine.Vertical)
     {
         hiding.Initialize(new Vector2(Size, graphics.GraphicsDevice.Viewport.Height), direction);
     }
 }
コード例 #4
0
        /// <summary>
        /// Initialize The Effect
        /// </summary>
        /// <param name="size">Set Size Of Each Image In The Collection Effect</param>
        /// <param name="direction">Effect Direction</param>
        public void Initialize(Vector2 size, Enumeration.EDirection direction)
        {
            this.dir  = direction;
            w         = (int)(firstbg.Size.X / size.X);
            time      = 10;
            h         = (int)(firstbg.Size.Y / size.Y);
            img       = new Image[w, h];
            hide      = new bool[w, h];
            this.size = size;


            this.Reset();
        }
コード例 #5
0
ファイル: HidingSquare.cs プロジェクト: MehdiTAZI/Chimera-2D
 /// <summary>
 /// Initialize The Effect
 /// </summary>
 /// <param name="Size">Image Size</param>
 /// <param name="direction">Effect Direction</param>
 public void Initialize(float Size, Enumeration.EDirection direction)
 {
     hiding.Initialize(new Vector2(Size, Size), direction);
 }
コード例 #6
0
 /// <summary>
 /// Set Frame
 /// </summary>
 /// <param name="gameTime">XNA GameTime Reference</param>
 /// <param name="dir">Direction Enumeration</param>
 public void SetNewFrame(GameTime gameTime, Enumeration.EDirection dir)
 {
     current_animation = 0;
     SetAnimation(gameTime, dir);
 }