2
0

EditorBuiltin.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. using System.Runtime.CompilerServices;
  2. using BansheeEngine;
  3. namespace BansheeEditor
  4. {
  5. /// <summary>
  6. /// Types of icons that may be displayed on the tool bar.
  7. /// </summary>
  8. public enum ToolbarIcon // Note: Must match C++ enum ToolbarIcon
  9. {
  10. NewCamera, NewRenderable, NewPointLight, NewDirLight, NewSpotLight, NewSceneObject, NewCube, NewSphere, NewCone,
  11. NewQuad, NewMat, NewCSScript, NewShader, NewSpriteTex, Pause, Play, Step, Undo, Redo, OpenProject, SaveProject,
  12. SaveScene
  13. };
  14. /// <summary>
  15. /// Types of icons that may be displayed in the scene window.
  16. /// </summary>
  17. public enum SceneWindowIcon // Note: Must match C++ enum SceneWindowIcon
  18. {
  19. View, Move, Rotate, Scale, Pivot, Center, Local, World, MoveSnap, RotateSnap
  20. };
  21. /// <summary>
  22. /// Types of icons that may be displayed in the library window.
  23. /// </summary>
  24. public enum LibraryWindowIcon // Note: Must match C++ enum LibraryWindowIcon
  25. {
  26. Home, Up, Clear, Options
  27. };
  28. /// <summary>
  29. /// Types of icons that may be displayed in the inspector window.
  30. /// </summary>
  31. public enum InspectorWindowIcon // Note: Must match C++ enum InspectorWindowIcon
  32. {
  33. Create, Clone, Clear, Resize, Delete, MoveUp, MoveDown, Edit, Apply, Add, Cancel
  34. };
  35. /// <summary>
  36. /// Types of icons that may be displayed for resources in the library window.
  37. /// </summary>
  38. public enum LibraryItemIcon // Note: Must match C++ enum ProjectIcon
  39. {
  40. Folder, Mesh, Font, Texture, PlainText, ScriptCode, SpriteTexture, Shader, ShaderInclude, Material, Prefab, GUISkin
  41. };
  42. /// <summary>
  43. /// Contains various editor-specific resources that are always available.
  44. /// </summary>
  45. public static class EditorBuiltin
  46. {
  47. /// <summary>Returns a texture displaying an X button.</summary>
  48. public static SpriteTexture XBtnIcon { get { return Internal_GetXBtnIcon(); } }
  49. /// <summary>Returns text contained in the default "empty" shader.</summary>
  50. public static string EmptyShaderCode { get { return Internal_GetEmptyShaderCode(); } }
  51. /// <summary>Returns text contained in the default "empty" C# script.</summary>
  52. public static string EmptyCSScriptCode { get { return Internal_GetEmptyCSScriptCode(); } }
  53. /// <summary>
  54. /// Retrieves an icon used for displaying an entry in the library window.
  55. /// </summary>
  56. /// <param name="icon">Type of the icon to retrieve.</param>
  57. /// <param name="size">Size of the icon to retrieve in pixels. This will be rounded
  58. /// to nearest available size.</param>
  59. /// <returns>Sprite texture of the icon.</returns>
  60. public static SpriteTexture GetLibraryItemIcon(LibraryItemIcon icon, int size)
  61. {
  62. return Internal_GetLibraryItemIcon(icon, size);
  63. }
  64. /// <summary>
  65. /// Retrieves an icon that may be displayed on the main window's toolbar.
  66. /// </summary>
  67. /// <param name="icon">Type of icon to retrieve.</param>
  68. /// <returns>Sprite texture of the icon.</returns>
  69. public static SpriteTexture GetToolbarIcon(ToolbarIcon icon)
  70. {
  71. return Internal_GetToolbarIcon(icon);
  72. }
  73. /// <summary>
  74. /// Retrieves an icon that may be displayed on the library window.
  75. /// </summary>
  76. /// <param name="icon">Type of icon to retrieve.</param>
  77. /// <returns>Sprite texture of the icon.</returns>
  78. public static SpriteTexture GetLibraryWindowIcon(LibraryWindowIcon icon)
  79. {
  80. return Internal_GetLibraryWindowIcon(icon);
  81. }
  82. /// <summary>
  83. /// Retrieves an icon that may be displayed on the inspector window.
  84. /// </summary>
  85. /// <param name="icon">Type of icon to retrieve.</param>
  86. /// <returns>Sprite texture of the icon.</returns>
  87. public static SpriteTexture GetInspectorWindowIcon(InspectorWindowIcon icon)
  88. {
  89. return Internal_GetInspectorWindowIcon(icon);
  90. }
  91. /// <summary>
  92. /// Retrieves an icon that may be displayed on the scene window.
  93. /// </summary>
  94. /// <param name="icon">Type of icon to retrieve.</param>
  95. /// <returns>Sprite texture of the icon.</returns>
  96. public static SpriteTexture GetSceneWindowIcon(SceneWindowIcon icon)
  97. {
  98. return Internal_GetSceneWindowIcon(icon);
  99. }
  100. [MethodImpl(MethodImplOptions.InternalCall)]
  101. private static extern SpriteTexture Internal_GetLibraryItemIcon(LibraryItemIcon icon, int size);
  102. [MethodImpl(MethodImplOptions.InternalCall)]
  103. private static extern SpriteTexture Internal_GetXBtnIcon();
  104. [MethodImpl(MethodImplOptions.InternalCall)]
  105. private static extern string Internal_GetEmptyShaderCode();
  106. [MethodImpl(MethodImplOptions.InternalCall)]
  107. private static extern string Internal_GetEmptyCSScriptCode();
  108. [MethodImpl(MethodImplOptions.InternalCall)]
  109. private static extern SpriteTexture Internal_GetToolbarIcon(ToolbarIcon icon);
  110. [MethodImpl(MethodImplOptions.InternalCall)]
  111. private static extern SpriteTexture Internal_GetLibraryWindowIcon(LibraryWindowIcon icon);
  112. [MethodImpl(MethodImplOptions.InternalCall)]
  113. private static extern SpriteTexture Internal_GetInspectorWindowIcon(InspectorWindowIcon icon);
  114. [MethodImpl(MethodImplOptions.InternalCall)]
  115. private static extern SpriteTexture Internal_GetSceneWindowIcon(SceneWindowIcon icon);
  116. }
  117. }