Rect.pkg 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. bool operator == (const Rect& rhs) const;
  10. void Define(const Rect& rect);
  11. void Define(const Vector2& min, const Vector2& max);
  12. void Define(const Vector2& point);
  13. void Merge(const Vector2& point);
  14. void Merge(const Rect& rect);
  15. void Clear();
  16. void Clip(const Rect& rect);
  17. Vector2 Center() const;
  18. Vector2 Size() const;
  19. Vector2 HalfSize() const;
  20. bool Equals(const Rect& rhs) const;
  21. Vector4 ToVector4() const;
  22. String ToString() const;
  23. Vector2 min_ @ min;
  24. Vector2 max_ @ max;
  25. static const Rect FULL;
  26. static const Rect POSITIVE;
  27. static const Rect ZERO;
  28. tolua_readonly tolua_property__no_prefix Vector2 center;
  29. tolua_readonly tolua_property__no_prefix Vector2 size;
  30. tolua_readonly tolua_property__no_prefix Vector2 halfSize;
  31. };
  32. class IntRect
  33. {
  34. IntRect();
  35. IntRect(int left, int top, int right, int bottom);
  36. bool operator == (const IntRect& rhs) const;
  37. IntVector2 Size() const;
  38. int Width() const;
  39. int Height() const;
  40. int left_ @ left;
  41. int top_ @ top;
  42. int right_ @ right;
  43. int bottom_ @ bottom;
  44. static const IntRect ZERO;
  45. tolua_readonly tolua_property__no_prefix IntVector2 size;
  46. tolua_readonly tolua_property__no_prefix int width;
  47. tolua_readonly tolua_property__no_prefix int height;
  48. };