internal AnimatedTexture(AnimatedTexture _Source) { mTexture = _Source.mTexture; mFrameSize = _Source.mFrameSize; SourceRec = new Rectangle(_Source.SourceRec.X, _Source.SourceRec.Y, _Source.SourceRec.Width, _Source.SourceRec.Height); Animations = _Source.Animations; CurrentAnimation = _Source.CurrentAnimation; Color = _Source.Color; DrawSize = _Source.DrawSize; mOwner = _Source.mOwner; mOwnerLastRotation = mOwner.Rotation; Anchor = _Source.Anchor; ShouldAnimate = _Source.ShouldAnimate; UpdateSourceRecPosition(); }
internal static void LoadContent(Microsoft.Xna.Framework.Content.ContentManager _Content) { MenuBackground = _Content.Load <Texture2D>("MenuBackground"); Dot = _Content.Load <Texture2D>("Dot"); Font = _Content.Load <SpriteFont>("PixelFont"); mCircle = new AnimatedTexture(_Content.Load <Texture2D>("FancyCircle"), new Vector2(594, 594), new Vector2(100, 100)); mCircle.AddAnimation(AnimationName.Idle, new Animation(AnimationName.Idle, new IntVector2(0, 0), 1, 1, false, false, false, true)); mExplosion = new AnimatedTexture(_Content.Load <Texture2D>("Explosion"), new Vector2(64, 64), new Vector2(64, 64)); mExplosion.AddAnimation(AnimationName.Idle, new Animation(AnimationName.Idle, new IntVector2(0, 0), 16, 0.01, false, true, false, true, true)); mTestSheet = new AnimatedTexture(_Content.Load <Texture2D>("TestSheet"), new Vector2(100, 100), new Vector2(100, 100)); mTestSheet.AddAnimation(AnimationName.Idle, new Animation(AnimationName.Idle, new IntVector2(0, 0), 7, 0.1, false, false, false, true)); mTestSheet.AddAnimation(AnimationName.SpecialOne, new Animation(AnimationName.SpecialOne, new IntVector2(0, 1), 7, 0.1, false, false, false, false)); mTestSheet.AddAnimation(AnimationName.SpecialTwo, new Animation(AnimationName.SpecialTwo, new IntVector2(0, 2), 7, 0.1, false, false, true, true)); mTestSheet.AddAnimation(AnimationName.SpecialThree, new Animation(AnimationName.SpecialThree, new IntVector2(0, 3), 7, 0.1, false, true, false, false)); mTestSheet.AddAnimation(AnimationName.SpecialFour, new Animation(AnimationName.SpecialFour, new IntVector2(0, 4), 7, 0.1, true, true, false, false)); }
internal AnimatedTexture(AnimatedTexture _Source, GameObject _Owner, Vector2?_Anchor, bool _StartAnimating = true) { mTexture = _Source.mTexture; mFrameSize = _Source.mFrameSize; SourceRec = _Source.SourceRec; Animations = _Source.Animations; CurrentAnimation = _Source.CurrentAnimation; Color = _Source.Color; DrawSize = _Source.DrawSize; mOwner = _Owner; mOwnerLastRotation = mOwner.Rotation; if (_Anchor.HasValue) { Anchor = _Anchor.Value; } else { Anchor = Vector2.Zero; } ShouldAnimate = _StartAnimating; }