public Timer(string id, Engine.Object parent) : base(id, parent) { _time = new Engine.TextObject("time", "Hud", this); var _timerFrame = new Engine.TexturedObject("frame", this, new Engine.SpriteSheet("Textures/Hud/TimerFrame")); _timerFrame.Position = new Vector2(-22, -25); Add(_timerFrame); Add(_time); }
public GSLogin(Engine.GameStateManager gameStateManager) : base("GSLogin", gameStateManager) { var backGround = new Engine.TexturedObject("background", HUD, new Engine.SpriteSheet("Textures/HUD/MainMenu")); AddToHud(backGround); var loginPopUpScreen = new LoginPopUp(HUD); loginPopUpScreen.Position = new Microsoft.Xna.Framework.Vector2(backGround.Width / 2 - loginPopUpScreen.Width / 2, backGround.Height / 2 - loginPopUpScreen.Height / 2); AddToHud(loginPopUpScreen); }
public DescriptionBox(Engine.Object parent, string text) : base("DescriptionBox", parent) { //create TextObject _description = new Engine.TextObject("description", "Hud", this); _description.Text = text; _description.Color = Color.Gray; //create the box and its frame _box = new Engine.TexturedObject("box", this, new Engine.SpriteSheet("Textures/HUD/DescriptionBox")); var textBox = new Rectangle(0, 0, _box.Width - 10, _box.Height); //set boundingBox equal to the boundingBox of box BoundingBox = _box.BoundingBox; //make sure the text fits perfectly into the _textBox and center it _description.FitIntoRectangle(textBox); _description.Position = new Vector2((Width - textBox.Width) / 2, Height / 2 - _description.Height / 2); //add both parts of the descriptionBox in the correct order Add(_box); Add(_description); }