//--------------------------------------------------------------------------------------------------------------------------------------------------- // // Copyright (C)2007 DarkWynter Studios. All rights reserved. // //--------------------------------------------------------------------------------------------------------------------------------------------------- // {Contact : darkwynter.com for licensing information //--------------------------------------------------------------------------------------------------------------------------------------------------- namespace DarkWynter.Engine.UserInterface { #region Using Statements using System; using System.Collections.Generic; using System.Collections; using System.Xml; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Storage; using DarkWynter.Stream; #endregion /// /// Used to display Text. /// public class TextDisplay : ScreenObject { /// /// The HUD ID of the Text Display /// public int id { get { return _id; } set { _id = value; } } private int _id; /// /// The location on the HUD of the text to be displayed /// public Vector2 location { get { return _location; } set { _location = value; } } private Vector2 _location; /// /// To draw or not to draw /// public bool isDraw { get { return _isDraw; } set { _isDraw = value; } } private bool _isDraw; /// /// The actual text of the text display /// public string message { get { return _message; } set { _message = value; } } private string _message; /// /// Path holding the font we want to use /// public string fontName { get { return _fontName; } set { _fontName = value; } } private string _fontName; /// /// The Color we want the text diplayed in /// public Color HUDColor { get { return _HUDColor; } set { _HUDColor = value; } } private Color _HUDColor; /// /// Text display constructor. /// public TextDisplay() { type = DisplayType.TEXT; } public void Load(XmlNode node) { this.id = int.Parse(node.Attributes["id"].Value); this.location = new Vector2( float.Parse(node.Attributes["x"].Value), float.Parse(node.Attributes["y"].Value) ); this.isDraw = bool.Parse(node.Attributes["draw"].Value); this.message = node.Attributes["message"].Value; this.fontName = node.Attributes["font"].Value; this.HUDColor = new Color(new Vector4( int.Parse(node.Attributes["r"].Value), int.Parse(node.Attributes["g"].Value), int.Parse(node.Attributes["b"].Value), int.Parse(node.Attributes["a"].Value) ) ); } public void Update() { } public void Draw(SpriteBatch spriteBatch) { } } }