Rect.pkg 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. $#include "Math/Rect.h"
  2. class Rect
  3. {
  4. Rect();
  5. Rect(const Rect& rect);
  6. Rect(const Vector2& min, const Vector2& max);
  7. Rect(float left, float top, float right, float bottom);
  8. Rect(const Vector4& vector);
  9. ~Rect();
  10. bool operator ==(const Rect& rhs) const;
  11. void Define(const Rect& rect);
  12. void Define(const Vector2& min, const Vector2& max);
  13. void Define(const Vector2& point);
  14. void Merge(const Vector2& point);
  15. void Merge(const Rect& rect);
  16. void Clear();
  17. void Clip(const Rect& rect);
  18. bool Defined() const;
  19. Vector2 Center() const;
  20. Vector2 Size() const;
  21. Vector2 HalfSize() const;
  22. bool Equals(const Rect& rhs) const;
  23. Intersection IsInside(const Vector2& point) const;
  24. Intersection IsInside(const Rect& rect) const;
  25. Vector4 ToVector4() const;
  26. String ToString() const;
  27. Vector2 min_ @ min;
  28. Vector2 max_ @ max;
  29. static const Rect FULL;
  30. static const Rect POSITIVE;
  31. static const Rect ZERO;
  32. tolua_readonly tolua_property__no_prefix Vector2 center;
  33. tolua_readonly tolua_property__no_prefix Vector2 size;
  34. tolua_readonly tolua_property__no_prefix Vector2 halfSize;
  35. };
  36. class IntRect
  37. {
  38. IntRect();
  39. IntRect(int left, int top, int right, int bottom);
  40. IntRect(const IntVector2& min, const IntVector2& max);
  41. ~IntRect();
  42. bool operator ==(const IntRect& rhs) const;
  43. IntVector2 Size() const;
  44. int Width() const;
  45. int Height() const;
  46. Intersection IsInside(const IntVector2& point) const;
  47. void Clip(const IntRect& rect);
  48. void Merge(const IntRect& rect);
  49. int left_ @ left;
  50. int top_ @ top;
  51. int right_ @ right;
  52. int bottom_ @ bottom;
  53. static const IntRect ZERO;
  54. tolua_readonly tolua_property__no_prefix IntVector2 size;
  55. tolua_readonly tolua_property__no_prefix int width;
  56. tolua_readonly tolua_property__no_prefix int height;
  57. };