Sprite.pkg 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. $#include "Sprite.h"
  2. enum BlendMode{};
  3. class Sprite : public UIElement
  4. {
  5. public:
  6. // Methods:
  7. Sprite(Context* context);
  8. virtual ~Sprite();
  9. void SetPosition(const Vector2& position);
  10. void SetPosition(float x, float y);
  11. void SetHotSpot(const IntVector2& hotSpot);
  12. void SetHotSpot(int x, int y);
  13. void SetScale(const Vector2& scale);
  14. void SetScale(float x, float y);
  15. void SetScale(float scale);
  16. void SetRotation(float angle);
  17. void SetTexture(Texture* texture);
  18. void SetImageRect(const IntRect& rect);
  19. void SetFullImageRect();
  20. void SetBlendMode(BlendMode mode);
  21. const Vector2& GetPosition() const;
  22. const IntVector2& GetHotSpot() const;
  23. const Vector2& GetScale() const;
  24. float GetRotation() const;
  25. Texture* GetTexture() const;
  26. const IntRect& GetImageRect() const;
  27. BlendMode GetBlendMode() const;
  28. void SetTextureAttr(ResourceRef value);
  29. ResourceRef GetTextureAttr() const;
  30. const Matrix3x4& GetTransform() const;
  31. // Properties:
  32. tolua_property__get_set Vector2& position;
  33. tolua_property__get_set IntVector2& hotSpot;
  34. tolua_property__get_set Vector2& scale;
  35. tolua_property__get_set float rotation;
  36. tolua_property__get_set Texture* texture;
  37. tolua_property__get_set IntRect& imageRect;
  38. tolua_property__get_set BlendMode blendMode;
  39. tolua_property__get_set ResourceRef textureAttr;
  40. tolua_readonly tolua_property__get_set Matrix3x4& transform;
  41. };