GUIContent.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System.Runtime.CompilerServices;
  2. namespace BansheeEngine
  3. {
  4. public sealed class GUIContent
  5. {
  6. public GUIContent(LocString text)
  7. {
  8. _text = text;
  9. }
  10. public GUIContent(LocString text, LocString tooltip)
  11. {
  12. _text = text;
  13. _tooltip = tooltip;
  14. }
  15. public GUIContent(SpriteTexture image)
  16. {
  17. _image = image;
  18. }
  19. public GUIContent(SpriteTexture image, LocString tooltip)
  20. {
  21. _image = image;
  22. _tooltip = tooltip;
  23. }
  24. public GUIContent(LocString text, SpriteTexture image)
  25. {
  26. _text = text;
  27. _image = image;
  28. }
  29. public GUIContent(LocString text, SpriteTexture image, LocString tooltip)
  30. {
  31. _text = text;
  32. _image = image;
  33. _tooltip = tooltip;
  34. }
  35. public static implicit operator GUIContent(LocString text)
  36. {
  37. return new GUIContent(text);
  38. }
  39. public static implicit operator GUIContent(string text)
  40. {
  41. return new GUIContent(new LocString(text));
  42. }
  43. public LocString text
  44. {
  45. get { return _text; }
  46. }
  47. public SpriteTexture image
  48. {
  49. get { return _image; }
  50. }
  51. public LocString getTooltip
  52. {
  53. get { return _tooltip; }
  54. }
  55. private LocString _text;
  56. private LocString _tooltip;
  57. private SpriteTexture _image;
  58. }
  59. }