public void Draw(SpriteBatchUI spriteBatch, int x, int y) { // determine if properties need to be updated. if (m_Entity != null && m_PropertyListHash != m_Entity.PropertyList.Hash) { m_PropertyListHash = m_Entity.PropertyList.Hash; Caption = m_Entity.PropertyList.Properties; } // update text if necessary. if (m_RenderedText == null) { m_RenderedText = new RenderedText("<center>" + Caption, 300, true); } else if (m_RenderedText.Text != "<center>" + Caption) { m_RenderedText = null; m_RenderedText = new RenderedText("<center>" + Caption, 300, true); } // draw checkered trans underneath. spriteBatch.Draw2DTiled(CheckerTrans.CheckeredTransTexture, new Rectangle(x - 4, y - 4, m_RenderedText.Width + 8, m_RenderedText.Height + 8), Vector3.Zero); // draw tooltip contents m_RenderedText.Draw(spriteBatch, new Point(x, y)); }
public void Draw(SpriteBatchUI spriteBatch, int x, int y) { // draw checkered trans underneath. if (m_RenderedText == null) { m_RenderedText = new RenderedText(Caption, 200); } spriteBatch.Draw2DTiled(Controls.CheckerTrans.CheckeredTransTexture, new Rectangle(x - 4, y - 4, m_RenderedText.Width + 8, m_RenderedText.Height + 8), Vector3.Zero); m_RenderedText.Draw(spriteBatch, new Point(x, y)); }
public override void Draw(SpriteBatchUI spriteBatch, Point position) { int centerWidth = Width - m_bgGumps[0].Width - m_bgGumps[2].Width; int centerHeight = Height - m_bgGumps[0].Height - m_bgGumps[6].Height; int line2Y = position.Y + m_bgGumps[0].Height; int line3Y = position.Y + Height - m_bgGumps[6].Height; spriteBatch.Draw2D(m_bgGumps[0], new Vector3(position.X, position.Y, 0), Vector3.Zero); spriteBatch.Draw2DTiled(m_bgGumps[1], new Rectangle(position.X + m_bgGumps[0].Width, position.Y, centerWidth, m_bgGumps[0].Height), Vector3.Zero); spriteBatch.Draw2D(m_bgGumps[2], new Vector3(position.X + Width - m_bgGumps[2].Width, position.Y, 0), Vector3.Zero); spriteBatch.Draw2DTiled(m_bgGumps[3], new Rectangle(position.X, line2Y, m_bgGumps[0].Width, centerHeight), Vector3.Zero); spriteBatch.Draw2DTiled(m_bgGumps[4], new Rectangle(position.X + m_bgGumps[0].Width, line2Y, centerWidth, centerHeight), Vector3.Zero); spriteBatch.Draw2DTiled(m_bgGumps[5], new Rectangle(position.X + Width - m_bgGumps[2].Width, line2Y, m_bgGumps[2].Width, centerHeight), Vector3.Zero); spriteBatch.Draw2D(m_bgGumps[6], new Vector3(position.X, line3Y, 0), Vector3.Zero); spriteBatch.Draw2DTiled(m_bgGumps[7], new Rectangle(position.X + m_bgGumps[0].Width, line3Y, centerWidth, m_bgGumps[6].Height), Vector3.Zero); spriteBatch.Draw2D(m_bgGumps[8], new Vector3(position.X + Width - m_bgGumps[2].Width, line3Y, 0), Vector3.Zero); base.Draw(spriteBatch, position); }
public override void Draw(SpriteBatchUI spriteBatch, Point position, double frameMS) { int centerWidth = Width - m_Gumps[0].Width - m_Gumps[2].Width; int centerHeight = Height - m_Gumps[0].Height - m_Gumps[6].Height; int line2Y = position.Y + m_Gumps[0].Height; int line3Y = position.Y + Height - m_Gumps[6].Height; // top row spriteBatch.Draw2D(m_Gumps[0], new Vector3(position.X, position.Y, 0), Vector3.Zero); spriteBatch.Draw2DTiled(m_Gumps[1], new Rectangle(position.X + m_Gumps[0].Width, position.Y, centerWidth, m_Gumps[0].Height), Vector3.Zero); spriteBatch.Draw2D(m_Gumps[2], new Vector3(position.X + Width - m_Gumps[2].Width, position.Y, 0), Vector3.Zero); // middle spriteBatch.Draw2DTiled(m_Gumps[3], new Rectangle(position.X, line2Y, m_Gumps[3].Width, centerHeight), Vector3.Zero); spriteBatch.Draw2DTiled(m_Gumps[4], new Rectangle(position.X + m_Gumps[3].Width, line2Y, centerWidth, centerHeight), Vector3.Zero); spriteBatch.Draw2DTiled(m_Gumps[5], new Rectangle(position.X + Width - m_Gumps[5].Width, line2Y, m_Gumps[5].Width, centerHeight), Vector3.Zero); // bottom spriteBatch.Draw2D(m_Gumps[6], new Vector3(position.X, line3Y, 0), Vector3.Zero); spriteBatch.Draw2DTiled(m_Gumps[7], new Rectangle(position.X + m_Gumps[6].Width, line3Y, centerWidth, m_Gumps[6].Height), Vector3.Zero); spriteBatch.Draw2D(m_Gumps[8], new Vector3(position.X + Width - m_Gumps[8].Width, line3Y, 0), Vector3.Zero); base.Draw(spriteBatch, position, frameMS); }
public override void Draw(SpriteBatchUI spriteBatch, Point position) { if (Height <= 0) return; // draw scrollbar background int middleHeight = Height - m_GumpUpButton[0].Height - m_GumpDownButton[0].Height - m_GumpBackground[0].Height - m_GumpBackground[2].Height; if (middleHeight > 0) { spriteBatch.Draw2D(m_GumpBackground[0], new Vector3(position.X, position.Y + m_GumpUpButton[0].Height, 0), Vector3.Zero); spriteBatch.Draw2DTiled(m_GumpBackground[1], new Rectangle(position.X, position.Y + m_GumpUpButton[0].Height + m_GumpBackground[0].Height, m_GumpBackground[0].Width, middleHeight), Vector3.Zero); spriteBatch.Draw2D(m_GumpBackground[2], new Vector3(position.X, position.Y + Height - m_GumpDownButton[0].Height - m_GumpBackground[2].Height, 0), Vector3.Zero); } else { middleHeight = Height - m_GumpUpButton[0].Height - m_GumpDownButton[0].Height; spriteBatch.Draw2DTiled(m_GumpBackground[1], new Rectangle(position.X, position.Y + m_GumpUpButton[0].Height, m_GumpBackground[0].Width, middleHeight), Vector3.Zero); } // draw up button spriteBatch.Draw2D(m_BtnUpClicked ? m_GumpUpButton[1] : m_GumpUpButton[0], new Vector3(position.X, position.Y, 0), Vector3.Zero); // draw down button spriteBatch.Draw2D(m_BtnDownClicked ? m_GumpDownButton[1] : m_GumpDownButton[0], new Vector3(position.X, position.Y + Height - m_GumpDownButton[0].Height, 0), Vector3.Zero); // draw slider if (MaxValue > MinValue && middleHeight > 0) spriteBatch.Draw2D(m_GumpSlider, new Vector3(position.X + (m_GumpBackground[0].Width - m_GumpSlider.Width) / 2, position.Y + m_GumpUpButton[0].Height + m_SliderPosition, 0), Vector3.Zero); base.Draw(spriteBatch, position); }
public override void Draw(SpriteBatchUI spriteBatch, Point position) { if (m_GumpSliderBackground != null) { spriteBatch.Draw2D(m_GumpSliderBackground[0], new Vector3(position.X, position.Y, 0), Vector3.Zero); spriteBatch.Draw2DTiled(m_GumpSliderBackground[1], new Rectangle(position.X + m_GumpSliderBackground[0].Width, position.Y, BarWidth - m_GumpSliderBackground[2].Width - m_GumpSliderBackground[0].Width, m_GumpSliderBackground[1].Height), Vector3.Zero); spriteBatch.Draw2D(m_GumpSliderBackground[2], new Vector3(position.X + BarWidth - m_GumpSliderBackground[2].Width, position.Y, 0), Vector3.Zero); } spriteBatch.Draw2D(m_GumpWidget, new Vector3(position.X + m_sliderX, position.Y, 0), Vector3.Zero); base.Draw(spriteBatch, position); }
public override void Draw(SpriteBatchUI spriteBatch, Point position) { spriteBatch.Draw2DTiled(m_bgGump, new Rectangle(position.X, position.Y, Width, Height), Vector3.Zero); base.Draw(spriteBatch, position); }
public override void Draw(SpriteBatchUI spriteBatch, Point position) { spriteBatch.Draw2DTiled(CheckeredTransTexture, new Rectangle(position.X, position.Y, Width, Height), Vector3.Zero); base.Draw(spriteBatch, position); }