Rect.pkg 1.6 KB

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