BsGUIInputSelection.h 841 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include "BsPrerequisites.h"
  3. #include "BsTextSprite.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_EXPORT GUIInputSelection
  7. {
  8. public:
  9. GUIInputSelection(const TEXT_SPRITE_DESC& textDesc);
  10. ~GUIInputSelection();
  11. CM::Vector<ImageSprite*>::type getSprites() const { return mSprites; }
  12. void updateText(const TEXT_SPRITE_DESC& textDesc);
  13. void updateSprite(const CM::Int2& offset);
  14. private:
  15. CM::UINT32 mSelectionStart;
  16. CM::UINT32 mSelectionEnd;
  17. CM::UINT32 mSelectionAnchor;
  18. CM::UINT32 mSelectionDragAnchor;
  19. TextSprite* mTextSprite; // TODO - Try to get rid of this and implement its methods internally?
  20. CM::Vector<ImageSprite*>::type mSprites;
  21. TEXT_SPRITE_DESC mTextDesc;
  22. CM::Vector<CM::Rect>::type getSelectionRects() const;
  23. bool isNewlineChar(CM::UINT32 charIdx) const;
  24. };
  25. }