public Sprite(String actorName, string actorState, float scale) { spriteEffects = SpriteEffects.None; Scale = scale; string[] split = actorName.Split('.'); _lookUpName = split[split.Length - 1] + "-" + actorState; //this seems silly but IDK it works if (AnimationRepository.Animations.ContainsKey(_lookUpName)) _animation = (Animation)AnimationRepository.Animations[_lookUpName]; else _animation = (Animation) AnimationRepository.Animations["none"]; }
public Sprite(String actorName, string actorState, float scale, Vector2 position, float roation, Vector2 direction, String weapon) { spriteEffects = SpriteEffects.None; Scale = scale; string[] split = actorName.Split('.'); _lookUpName = split[split.Length - 1] + "-" + actorState; //this seems silly but IDK it works _lookUpName += "-" + weapon; if (AnimationRepository.Animations.ContainsKey(_lookUpName)) _animation = (Animation)AnimationRepository.Animations[_lookUpName]; else _animation = (Animation)AnimationRepository.Animations["none"]; Position = position; Roation = roation; if (direction.X < 0) spriteEffects = SpriteEffects.FlipHorizontally; }
private static object addAnimation(Texture2D texture2D, int p, double p2, Boolean loop, Boolean repeat) { Animation animation = new Animation(texture2D, p, p2, loop, repeat); return animation; }
private static object addAnimation(Texture2D texture2D, int p, double p2) { Animation animation = new Animation(texture2D, p, p2); return animation; }