Beispiel #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);
                }
            }
        }
		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;
		}
Beispiel #3
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);
        }
Beispiel #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 );
				}
			}
		}
		public SpriteAnimationFrame( SpriteAnimationFrameImage[] images ) {
			Images = new List<SpriteAnimationFrameImage>();
			for( int i = 0; i < images.Length; i++ )
				Images.Add( images[ i ].Clone() as SpriteAnimationFrameImage );
		}