Esempio n. 1
0
	void Slider::OnRender(Renderer2D& renderer)
	{
		renderer.FillRect(m_Bounds, 0xcf7f7f7f);
		renderer.DrawRect(m_Bounds);

		renderer.FillRect(m_HeadBounds, 0xcfbfbfbf);
		renderer.DrawRect(m_HeadBounds);

		vec2 offset = m_Vertical ? vec2(0, m_Bounds.size.y / 2.0f) : vec2(m_Bounds.size.x / 2.0f, 0);
		renderer.DrawLine(m_Bounds.Center() - offset, m_Bounds.Center() + offset);
	}
Esempio n. 2
0
	void Button::OnRender(Renderer2D& renderer)
	{
		float horizontalPadding = debug::DebugMenu::GetSettings().horizontalPadding * 0.5f;

		renderer.DrawRect(m_Bounds);
		renderer.FillRect(m_Bounds, m_State == ButtonState::PRESSED ? 0xcfbbbbbb : 0xcf5f5f5f);
		renderer.DrawString(m_Label, m_Bounds.position - vec2(m_Bounds.width - horizontalPadding, m_Font->GetHeight(m_Label) * 0.5f), *m_Font); // TODO: Actually use a Label
	}