BorderImage.pkg 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. $#include "BorderImage.h"
  2. enum BlendMode{};
  3. /// %Image %UI element with optional border.
  4. class BorderImage : public UIElement
  5. {
  6. public:
  7. /// Set texture.
  8. void SetTexture(Texture* texture);
  9. /// Set part of texture to use as the image.
  10. void SetImageRect(const IntRect& rect);
  11. /// Use whole texture as the image.
  12. void SetFullImageRect();
  13. /// Set image border dimensions.
  14. void SetBorder(const IntRect& rect);
  15. /// Set offset to image rectangle used on hover.
  16. void SetHoverOffset(const IntVector2& offset);
  17. /// Set offset to image rectangle used on hover.
  18. void SetHoverOffset(int x, int y);
  19. /// Set blend mode.
  20. void SetBlendMode(BlendMode mode);
  21. /// Set tiled mode.
  22. void SetTiled(bool enable);
  23. /// Return texture.
  24. Texture* GetTexture() const { return texture_; }
  25. /// Return image rectangle.
  26. const IntRect& GetImageRect() const { return imageRect_; }
  27. /// Return image border dimensions.
  28. const IntRect& GetBorder() const { return border_; }
  29. /// Return offset to image rectangle used on hover.
  30. const IntVector2& GetHoverOffset() const { return hoverOffset_; }
  31. /// Return blend mode.
  32. BlendMode GetBlendMode() const { return blendMode_; }
  33. /// Return whether is tiled.
  34. bool IsTiled() const { return tiled_; }
  35. };