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"; }
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); }
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); }
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; }
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); }
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); }