Rect.pkg 1.7 KB

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