2
0

UIImage.cpp 639 B

1234567891011121314151617181920212223242526272829
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #include <TestFramework.h>
  5. #include <Renderer/Renderer.h>
  6. #include <UI/UIImage.h>
  7. #include <UI/UIManager.h>
  8. JPH_IMPLEMENT_RTTI_VIRTUAL(UIImage)
  9. {
  10. JPH_ADD_BASE_CLASS(UIImage, UIElement)
  11. }
  12. void UIImage::Draw() const
  13. {
  14. GetManager()->DrawQuad(GetX(), GetY(), GetWidth(), GetHeight(), mImage, Color::sWhite);
  15. UIElement::Draw();
  16. }
  17. void UIImage::CopyTo(UIElement *ioElement) const
  18. {
  19. UIElement::CopyTo(ioElement);
  20. UIImage *element = StaticCast<UIImage>(ioElement);
  21. element->mImage = mImage;
  22. }