/// <summary> /// Render /// </summary> /// <param name="batch"></param> public override void Draw(UISpriteBatch batch) { if (m_DrawDirty) { ComputeDrawingCommands(); } /** Can have a text box without a background **/ if (m_BackgroundTex != null && NineSliceMargins != null) { NineSliceMargins.DrawOnto(batch, this, m_BackgroundTex, m_Width, m_Height); } /** * Draw text */ foreach (var cmd in m_DrawCmds) { cmd.Draw(this, batch); } }
/// <summary> /// Render /// </summary> /// <param name="batch"></param> public override void Draw(UISpriteBatch batch) { if (!Visible) { return; } if (m_DrawDirty) { ComputeDrawingCommands(); } /** Can have a text box without a background **/ if (m_BackgroundTex != null && NineSliceMargins != null) { NineSliceMargins.DrawOnto(batch, this, m_BackgroundTex, m_Width, m_Height); } if (m_BackgroundTexRef != null) { m_BackgroundTexRef.Draw(batch, this, 0, 0, m_Width, m_Height); } /** * Draw border */ if (m_frameBlinkOn && m_frameBlink) { DrawingUtils.DrawBorder(batch, LocalRect(0, 0, m_Width, m_Height), 1, m_FrameTexture, Color.White); } /** * Draw text */ foreach (var cmd in m_DrawCmds) { cmd.Draw(this, batch); } }