BsGUIOptions.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #include "BsGUIOptions.h"
  2. namespace BansheeEngine
  3. {
  4. GUIOption::GUIOption()
  5. :min(0), max(0), type(Type::FixedWidth)
  6. {
  7. }
  8. GUIOption GUIOption::position(INT32 x, INT32 y)
  9. {
  10. GUIOption option;
  11. option.min = (UINT32)x;
  12. option.max = (UINT32)y;
  13. option.type = Type::Position;
  14. return option;
  15. }
  16. GUIOption GUIOption::fixedWidth(UINT32 value)
  17. {
  18. GUIOption option;
  19. option.min = option.max = value;
  20. option.type = Type::FixedWidth;
  21. return option;
  22. }
  23. GUIOption GUIOption::flexibleWidth(UINT32 min, UINT32 max)
  24. {
  25. GUIOption option;
  26. option.min = min;
  27. option.max = max;
  28. option.type = Type::FlexibleWidth;
  29. return option;
  30. }
  31. GUIOption GUIOption::fixedHeight(UINT32 value)
  32. {
  33. GUIOption option;
  34. option.min = option.max = value;
  35. option.type = Type::FixedHeight;
  36. return option;
  37. }
  38. GUIOption GUIOption::flexibleHeight(UINT32 min, UINT32 max)
  39. {
  40. GUIOption option;
  41. option.min = min;
  42. option.max = max;
  43. option.type = Type::FlexibleHeight;
  44. return option;
  45. }
  46. }