2
0

GUIElementStateStyle.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. namespace BansheeEngine
  4. {
  5. /// <summary>
  6. /// Container for texture and text color used in a particular GUI element style.
  7. /// </summary>
  8. public sealed class GUIElementStateStyle : ScriptObject
  9. {
  10. /// <summary>
  11. /// Constructs a new GUI element state style with default values.
  12. /// </summary>
  13. public GUIElementStateStyle()
  14. {
  15. Internal_CreateInstance(this);
  16. }
  17. /// <summary>
  18. /// Texture used by the GUI element style state. Can be null.
  19. /// </summary>
  20. public SpriteTexture texture
  21. {
  22. get { SpriteTexture value; Internal_GetTexture(mCachedPtr, out value); return value; }
  23. set { Internal_SetTexture(mCachedPtr, value); }
  24. }
  25. /// <summary>
  26. /// Color applied to the text when GUI element style state is active.
  27. /// </summary>
  28. public Color textColor
  29. {
  30. get { Color value; Internal_GetTextColor(mCachedPtr, out value); return value; }
  31. set { Internal_SetTextColor(mCachedPtr, ref value); }
  32. }
  33. [MethodImpl(MethodImplOptions.InternalCall)]
  34. private static extern void Internal_CreateInstance(GUIElementStateStyle instance);
  35. [MethodImpl(MethodImplOptions.InternalCall)]
  36. private static extern void Internal_GetTexture(IntPtr nativeInstance, out SpriteTexture value);
  37. [MethodImpl(MethodImplOptions.InternalCall)]
  38. private static extern void Internal_SetTexture(IntPtr nativeInstance, SpriteTexture value);
  39. [MethodImpl(MethodImplOptions.InternalCall)]
  40. private static extern void Internal_GetTextColor(IntPtr nativeInstance, out Color value);
  41. [MethodImpl(MethodImplOptions.InternalCall)]
  42. private static extern void Internal_SetTextColor(IntPtr nativeInstance, ref Color value);
  43. };
  44. }