BorderImage.pkg 1.4 KB

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