BsGUIVector2Field.h 975 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 GUIDimensions& dimensions, bool withLabel);
  14. Vector2 getValue() const;
  15. void setValue(const Vector2& value);
  16. bool hasInputFocus() const;
  17. /**
  18. * @copydoc GUIElement::setTint
  19. */
  20. virtual void setTint(const Color& color);
  21. Event<void(const Vector2&)> onValueChanged;
  22. protected:
  23. virtual ~GUIVector2Field() { }
  24. protected:
  25. static const UINT32 ELEMENT_LABEL_WIDTH;
  26. void styleUpdated();
  27. void valueChanged(float newValue);
  28. GUIFloatField* mFieldX;
  29. GUIFloatField* mFieldY;
  30. };
  31. }