Ejemplo n.º 1
0
        public void Initialize(GraphicsDevice GraphicsDevice)
        {
            // fetch all Actions & build SpriteAnimations from it
            for (int a = 0; a < mRagnarokAnimation.Actions.Count; a++)
            {
                mAnimation[a] = new SpriteAnimation();
                for (int f = 0; f < mRagnarokAnimation.Actions[a].Frames.Count; f++)
                {
                    SpriteAnimationFrame frame = new SpriteAnimationFrame();
                    for (int i = 0; i < mRagnarokAnimation.Actions[a].Frames[f].Images.Count; i++)
                    {
                        RagnarokAnimationActionFrameImage roImg = mRagnarokAnimation.Actions[a].Frames[f].Images[i];
                        SpriteAnimationFrameImage         img   = new SpriteAnimationFrameImage();
                        img.Size     = new Point((int)(roImg.Width * roImg.ScaleX), (int)(roImg.Height * roImg.ScaleY));
                        img.Position = new Point(roImg.X, roImg.Y);
                        img.Rotation = roImg.Rotation;
                        img.Texture  = mRagnarokAnimation.Images[roImg.Number].BuildTexture2D(mRagnarokAnimation.Palette, GraphicsDevice);
                        img.Color    = Color.White;
                        img.Mirror   = (roImg.Mirror ? SpriteEffects.FlipHorizontally : SpriteEffects.None);


                        frame.Images.Add(img);
                    }

                    mAnimation[a].Frames.Add(frame);
                }
            }
        }
Ejemplo n.º 2
0
		public object Clone() {
			SpriteAnimationFrameImage img = new SpriteAnimationFrameImage();
			img.Texture = Texture;
			img.Size = Size;
			img.Position = Position;
			img.Mirror = Mirror;
			img.Alpha = Alpha;
			img.Rotation = Rotation;
			img.Color = Color;
			return img;
		}
        public object Clone()
        {
            SpriteAnimationFrameImage img = new SpriteAnimationFrameImage();

            img.Texture  = Texture;
            img.Size     = Size;
            img.Position = Position;
            img.Mirror   = Mirror;
            img.Alpha    = Alpha;
            img.Rotation = Rotation;
            img.Color    = Color;
            return(img);
        }
Ejemplo n.º 4
0
		public void Initialize( GraphicsDevice GraphicsDevice ) {
			// fetch all Actions & build SpriteAnimations from it
			for( int a = 0; a < mRagnarokAnimation.Actions.Count; a++ ) {
				mAnimation[ a ] = new SpriteAnimation();
				for( int f = 0; f < mRagnarokAnimation.Actions[ a ].Frames.Count; f++ ) {
					SpriteAnimationFrame frame = new SpriteAnimationFrame();
					for( int i = 0; i < mRagnarokAnimation.Actions[ a ].Frames[ f ].Images.Count; i++ ) {
						RagnarokAnimationActionFrameImage roImg = mRagnarokAnimation.Actions[ a ].Frames[ f ].Images[ i ];
						SpriteAnimationFrameImage img = new SpriteAnimationFrameImage();
						img.Size = new Point( (int)( roImg.Width * roImg.ScaleX ), (int)( roImg.Height * roImg.ScaleY ) );
						img.Position = new Point( roImg.X, roImg.Y );
						img.Rotation = roImg.Rotation;
						img.Texture = mRagnarokAnimation.Images[ roImg.Number ].BuildTexture2D( mRagnarokAnimation.Palette, GraphicsDevice );
						img.Color = Color.White;
						img.Mirror = ( roImg.Mirror ? SpriteEffects.FlipHorizontally : SpriteEffects.None );


						frame.Images.Add( img );
					}

					mAnimation[ a ].Frames.Add( frame );
				}
			}
		}
Ejemplo n.º 5
0
		public SpriteAnimationFrame( SpriteAnimationFrameImage[] images ) {
			Images = new List<SpriteAnimationFrameImage>();
			for( int i = 0; i < images.Length; i++ )
				Images.Add( images[ i ].Clone() as SpriteAnimationFrameImage );
		}