//--------------------------------------------------------------------------------------------------------------------------------------------------- // // 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 ImageDisplay : 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 Texture2D texture { get { return _texture; } set { _texture = value; } } private Texture2D _texture; /// /// The Color we want the text diplayed in /// public Color HUDColor { get { return _HUDColor; } set { _HUDColor = value; } } private Color _HUDColor; /// /// Text display constructor. /// public ImageDisplay() { 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.texture = Statics_Engine.SystemSettings.content.Load(node.Attributes["texture"].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) { } } }