Rect.pkg 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. Vector4 ToVector4() const;
  25. String ToString() const;
  26. Vector2 min_ @ min;
  27. Vector2 max_ @ max;
  28. static const Rect FULL;
  29. static const Rect POSITIVE;
  30. static const Rect ZERO;
  31. tolua_readonly tolua_property__no_prefix Vector2 center;
  32. tolua_readonly tolua_property__no_prefix Vector2 size;
  33. tolua_readonly tolua_property__no_prefix Vector2 halfSize;
  34. };
  35. class IntRect
  36. {
  37. IntRect();
  38. IntRect(int left, int top, int right, int bottom);
  39. ~IntRect();
  40. bool operator ==(const IntRect& rhs) const;
  41. IntVector2 Size() const;
  42. int Width() const;
  43. int Height() const;
  44. Intersection IsInside(const IntVector2& point) const;
  45. int left_ @ left;
  46. int top_ @ top;
  47. int right_ @ right;
  48. int bottom_ @ bottom;
  49. static const IntRect ZERO;
  50. tolua_readonly tolua_property__no_prefix IntVector2 size;
  51. tolua_readonly tolua_property__no_prefix int width;
  52. tolua_readonly tolua_property__no_prefix int height;
  53. };