Exemplo n.º 1
0
        public AnimatieGFX(Texture2D tex, Vector2 pos)
        {
            this.texture  = tex;
            this.position = pos;
            animatie      = new SpriteAnimation(texture, 8, 1);
            anime         = new AnimationClass();

            animatie.AddAnimation("flow", 1, 8, anime.Copy());
            animatie.Animation = "flow";
        }
        public AnimatieGFX(Texture2D tex,Vector2 pos)
        {
            this.texture = tex;
            this.position = pos;
            animatie = new SpriteAnimation(texture, 8, 1);
            anime = new AnimationClass();

            animatie.AddAnimation("flow", 1, 8, anime.Copy());
            animatie.Animation = "flow";
        }
Exemplo n.º 3
0
        public void AddAnimation(string name, int row,int frames,AnimationClass animation)
        {
            //animatie toevoegen
            Rectangle[] recs = new Rectangle[frames];
            for (int i = 0; i < frames; i++)
            {
                recs[i] = new Rectangle(i * width, (row - 1) * height, width, height);
            }

            animation.Frames = frames;
            animation.Rectangles = recs;
            Animations.Add(name, animation);
        }
Exemplo n.º 4
0
        public void AddAnimation(string name, int row, int frames, AnimationClass animation)
        {
            //animatie toevoegen
            Rectangle[] recs = new Rectangle[frames];
            for (int i = 0; i < frames; i++)
            {
                recs[i] = new Rectangle(i * width, (row - 1) * height, width, height);
            }

            animation.Frames     = frames;
            animation.Rectangles = recs;
            Animations.Add(name, animation);
        }
Exemplo n.º 5
0
 public AnimationClass Copy()
 {
     //kopie maken voor de volgende animatie
     AnimationClass ac = new AnimationClass();
     ac.Rectangles = Rectangles;
     ac.Color = Color;
     ac.Origin = Origin;
     ac.Rotation = Rotation;
     ac.Scale = Scale;
     ac.SpriteEffect = SpriteEffect;
     ac.IsLooping = IsLooping;
     ac.Frames = Frames;
     return ac;
 }
Exemplo n.º 6
0
        public AnimationClass Copy()
        {
            //kopie maken voor de volgende animatie
            AnimationClass ac = new AnimationClass();

            ac.Rectangles   = Rectangles;
            ac.Color        = Color;
            ac.Origin       = Origin;
            ac.Rotation     = Rotation;
            ac.Scale        = Scale;
            ac.SpriteEffect = SpriteEffect;
            ac.IsLooping    = IsLooping;
            ac.Frames       = Frames;
            return(ac);
        }
Exemplo n.º 7
0
        public AnimateSprite(Texture2D tex, Vector2 pos,int frames,int animations)
        {
            texture = tex;
            //position = pos;
            velocity = Vector2.Zero;

            anime = new AnimationClass();
            animation = new SpriteAnimation(texture,frames,animations);
            animation.Position = pos;
            animation.AddAnimation("normal",1,frames,anime.Copy());
            animation.Animation = "normal";
            bounds = animation.Bounds;
            origin = new Vector2(animation.width / 2, animation.height / 2);
            //bounds = new Rectangle((int)position.X, (int)position.Y, animation.width,animation.height);
        }