Rect.pkg 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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();
  41. bool operator ==(const IntRect& rhs) const;
  42. IntVector2 Size() const;
  43. int Width() const;
  44. int Height() const;
  45. Intersection IsInside(const IntVector2& point) const;
  46. int left_ @ left;
  47. int top_ @ top;
  48. int right_ @ right;
  49. int bottom_ @ bottom;
  50. static const IntRect ZERO;
  51. tolua_readonly tolua_property__no_prefix IntVector2 size;
  52. tolua_readonly tolua_property__no_prefix int width;
  53. tolua_readonly tolua_property__no_prefix int height;
  54. };