public CharacterHUD(int x, int y, int width, int height, SSCEnums.PlayerID Player) : base(x, y, width, height, false) { this.background = new AnimatedSprite("Background", new Vector2(x, y), new AnimationManager(SeasideScramble.self.textureUtils.getExtendedTexture("SSCUI", "DialogBox"), new Animation(0, 0, 32, 32)), Color.White); this.playerID = Player; this.showHUD = false; this.heart = new AnimatedSprite("Heart", new Vector2(x + 32, y + 10), new AnimationManager(SeasideScramble.self.textureUtils.getExtendedTexture("SSCUI", "Heart"), new Animation(0, 0, 7, 6), new Dictionary <string, List <Animation> >() { { "Full", new List <Animation>() { new Animation(0, 0, 7, 6) } }, { "Empty", new List <Animation>() { new Animation(7, 0, 7, 6) } } }, "Full"), Color.White); this.heart.animation.playAnimation("Full"); this.playerHealth = SeasideScramble.self.gameFont.ParseString("100", new Vector2(100, this.yPositionOnScreen + 10), Color.White, true, 2f); this.playerHealth.setPosition(new Vector2(this.xPositionOnScreen + 100, this.yPositionOnScreen + 10)); this.showFullHeart = true; this.gun = new AnimatedSprite("Gun", new Vector2(x + 32, y + 50), new AnimationManager(SeasideScramble.self.textureUtils.getExtendedTexture("Guns", "BasicGun"), new Animation(0, 0, 16, 16)), Color.White); this.playerAmmo = SeasideScramble.self.gameFont.ParseString("100", new Vector2(100, this.yPositionOnScreen + 50), Color.White, true, 2f); this.playerAmmo.setPosition(new Vector2(this.xPositionOnScreen + 100, this.yPositionOnScreen + 50)); this.clock = new AnimatedSprite("Clock", new Vector2(x + 32, y + 50), new AnimationManager(SeasideScramble.self.textureUtils.getExtendedTexture("SSCUI", "Clock"), new Animation(0, 0, 11, 10)), Color.White); this.reloadTime = SeasideScramble.self.gameFont.ParseString("100", new Vector2(100, this.yPositionOnScreen + 50), Color.White, true, 2f); this.reloadTime.setPosition(new Vector2(this.xPositionOnScreen + 100, this.yPositionOnScreen + 50)); this.targetsHit = new AnimatedSprite("Target", new Vector2(x + 32, y + 100), new AnimationManager(SeasideScramble.self.textureUtils.getExtendedTexture("Enemies", "Target"), new Animation(0, 0, 16, 16)), Color.White); this.targetsScoreText = SeasideScramble.self.gameFont.ParseString("000", new Vector2(100, this.yPositionOnScreen + 110), Color.White, true, 2f); this.targetsScoreText.setPosition(new Vector2(this.xPositionOnScreen + 100, this.yPositionOnScreen + 110)); }
/// <summary> /// Takes a string and returns a textured string in it's place. Also sets the new position. /// </summary> /// <param name="str"></param> /// <param name="Position"></param> /// <returns></returns> public TexturedString ParseString(string str, Vector2 Position) { List <TexturedCharacter> characters = new List <TexturedCharacter>(); foreach (var chr in str) { characters.Add(characterSheet.getTexturedCharacter(chr)); } var tStr = new TexturedString(str, Position, characters); return(tStr); }
/// <summary> /// Takes a string and returns a textured string in it's place. /// </summary> /// <param name="str"></param> /// <returns></returns> public TexturedString ParseString(string str) { List <TexturedCharacter> characters = new List <TexturedCharacter>(); foreach (var chr in str) { characters.Add(characterSheet.getTexturedCharacter(chr)); } var tStr = new TexturedString(str, new Microsoft.Xna.Framework.Vector2(0, 0), characters); return(tStr); }
/// <summary> /// Takes a string and returns a textured string in it's place. Also sets the new position, label and string color. /// </summary> /// <param name="label">The label for the string.</param> /// <param name="str">The string that wil be parsed into textured characters.</param> /// <param name="Position">The position to draw the textured string.</param> /// <param name="stringColor">The color of the textured string.</param> /// <returns></returns> public TexturedString ParseString(string label, string str, Vector2 Position, Color stringColor, bool useRightPadding = true) { List <TexturedCharacter> characters = new List <TexturedCharacter>(); foreach (var chr in str) { var c = characterSheet.getTexturedCharacter(chr); c.drawColor = stringColor; characters.Add(c); } var tStr = new TexturedString(label, Position, characters, false); return(tStr); }
/// <summary> /// Takes a string and returns a textured string in it's place. Also sets the new position and string color. /// </summary> /// <param name="str"></param> /// <param name="Position"></param> /// <param name="stringColor"></param> /// <returns></returns> public TexturedString ParseString(string str, Vector2 Position, Color stringColor) { List <TexturedCharacter> characters = new List <TexturedCharacter>(); foreach (var chr in str) { var c = characterSheet.getTexturedCharacter(chr); c.drawColor = stringColor; characters.Add(c); } var tStr = new TexturedString(Position, characters); return(tStr); }
/// <summary> /// Takes a string and returns a textured string in it's place. Also sets the new position and string color. /// </summary> /// <param name="str"></param> /// <param name="Position"></param> /// <param name="stringColor">The color for the individual characters.</param> /// <returns></returns> public TexturedString ParseString(string str, Vector2 Position, List <Color> stringColor) { List <TexturedCharacter> characters = new List <TexturedCharacter>(); int index = 0; foreach (var chr in str) { var c = characterSheet.getTexturedCharacter(chr); c.drawColor = stringColor.ElementAt(index); characters.Add(c); index++; } var tStr = new TexturedString(str, Position, characters); return(tStr); }