GUILayoutUtility.cs 951 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.CompilerServices;
  5. using System.Text;
  6. namespace BansheeEngine
  7. {
  8. public class GUILayoutUtility
  9. {
  10. public static Vector2I CalculateOptimalSize(GUIElement element)
  11. {
  12. Vector2I output;
  13. Internal_CalculateOptimalSize(element.GetCachedPtr(), out output);
  14. return output;
  15. }
  16. public static Rect2I CalculateBounds(GUIElement element)
  17. {
  18. Rect2I output;
  19. Internal_CalculateBounds(element.GetCachedPtr(), out output);
  20. return output;
  21. }
  22. [MethodImpl(MethodImplOptions.InternalCall)]
  23. private static extern void Internal_CalculateOptimalSize(IntPtr element, out Vector2I output);
  24. [MethodImpl(MethodImplOptions.InternalCall)]
  25. private static extern void Internal_CalculateBounds(IntPtr element, out Rect2I output);
  26. }
  27. }