Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. void CSlider::Draw(bool hover)
  2. {
  3. POINT a = GetAbsolutePos();
  4.  
  5. Render::Clear(a.x, a.y + 3, m_iWidth, 6, Color(1, 1, 1, 255));
  6. Render::Clear(a.x+1, a.y + 4, m_iWidth-2, 4, Color(105, 105, 105, 255));
  7. Render::Clear(a.x+2, a.y + 5, m_iWidth-4, 2, Color(68, 68, 68, 255));
  8.  
  9. float Ratio = Value / (Max - Min);
  10. float Location = Ratio*m_iWidth;
  11.  
  12. Render::Clear(a.x + 2, a.y + 5, a.x + 2 + Location, 2, Color(60, 160, 0, 255));
  13. //Render::Outline(a.x + Location, a.y + 1, 4, 9, Color(20, 20, 20, 80));
  14.  
  15. char buffer[24];
  16. sprintf_s(buffer, "%.2f", Value);
  17. RECT txtSize = Render::GetTextSize(Render::Fonts::MenuBold, buffer);
  18. Render::Text(a.x + (m_iWidth / 2) - txtSize.right, a.y, Color(255, 255, 255, 255), Render::Fonts::MenuBold, buffer);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement