GUILabel.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. namespace BansheeEngine
  4. {
  5. public sealed class GUILabel : GUIElement
  6. {
  7. public GUILabel(GUIContent content, string style, params GUIOption[] options)
  8. {
  9. Internal_CreateInstance(this, content, style, options);
  10. }
  11. public GUILabel(GUIContent content, string style = "")
  12. {
  13. Internal_CreateInstance(this, content, style, new GUIOption[0]);
  14. }
  15. public GUILabel(GUIContent content, params GUIOption[] options)
  16. {
  17. Internal_CreateInstance(this, content, "", options);
  18. }
  19. public void SetContent(GUIContent content)
  20. {
  21. Internal_SetContent(mCachedPtr, content);
  22. }
  23. public void SetTint(Color color)
  24. {
  25. Internal_SetTint(mCachedPtr, color);
  26. }
  27. [MethodImpl(MethodImplOptions.InternalCall)]
  28. private static extern void Internal_CreateInstance(GUILabel instance, GUIContent content, string style, GUIOption[] options);
  29. [MethodImpl(MethodImplOptions.InternalCall)]
  30. private static extern void Internal_SetContent(IntPtr nativeInstance, GUIContent content);
  31. [MethodImpl(MethodImplOptions.InternalCall)]
  32. private static extern void Internal_SetTint(IntPtr nativeInstance, Color color);
  33. }
  34. }