BsGUIVector2Field.h 885 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIFieldBase.h"
  4. #include "BsVector2.h"
  5. namespace BansheeEngine
  6. {
  7. class BS_ED_EXPORT GUIVector2Field : public TGUIField<GUIVector2Field>
  8. {
  9. public:
  10. static const String& getGUITypeName();
  11. static const String& getFloatFieldStyleType();
  12. GUIVector2Field(const PrivatelyConstruct& dummy, const GUIContent& labelContent, UINT32 labelWidth,
  13. const String& style, const GUILayoutOptions& layoutOptions, bool withLabel);
  14. Vector2 getValue() const;
  15. void setValue(const Vector2& value);
  16. bool hasInputFocus() const;
  17. Event<void(const Vector2&)> onValueChanged;
  18. protected:
  19. virtual ~GUIVector2Field() { }
  20. protected:
  21. static const UINT32 ELEMENT_LABEL_WIDTH;
  22. void styleUpdated();
  23. void valueChanged(float newValue);
  24. GUIFloatField* mFieldX;
  25. GUIFloatField* mFieldY;
  26. };
  27. }