EditorBuiltin.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. using System.Runtime.CompilerServices;
  4. using BansheeEngine;
  5. namespace BansheeEditor
  6. {
  7. /** @addtogroup Utility-Editor
  8. * @{
  9. */
  10. /// <summary>
  11. /// Types of icons that may be displayed on the tool bar.
  12. /// </summary>
  13. public enum ToolbarIcon // Note: Must match C++ enum ToolbarIcon
  14. {
  15. NewCamera, NewRenderable, NewPointLight, NewDirLight, NewSpotLight, NewSceneObject, NewCube, NewSphere, NewCone,
  16. NewQuad, NewMat, NewCSScript, NewShader, NewSpriteTex, Pause, Play, Step, Undo, Redo, OpenProject, SaveProject,
  17. SaveScene
  18. }
  19. /// <summary>
  20. /// Types of icons that may be displayed in the scene window.
  21. /// </summary>
  22. public enum SceneWindowIcon // Note: Must match C++ enum SceneWindowIcon
  23. {
  24. View, Move, Rotate, Scale, Pivot, Center, Local, World, MoveSnap, RotateSnap
  25. }
  26. /// <summary>
  27. /// Types of icons that may be displayed in the library window.
  28. /// </summary>
  29. public enum LibraryWindowIcon // Note: Must match C++ enum LibraryWindowIcon
  30. {
  31. Home, Up, Clear, Options
  32. }
  33. /// <summary>
  34. /// Types of icons that may be displayed in the inspector window.
  35. /// </summary>
  36. public enum InspectorWindowIcon // Note: Must match C++ enum InspectorWindowIcon
  37. {
  38. Create, Clone, Clear, Resize, Delete, MoveUp, MoveDown, Edit, Apply, Add, Cancel
  39. }
  40. /// <summary>
  41. /// Types of icons that may be displayed for resources in the library window.
  42. /// </summary>
  43. public enum LibraryItemIcon // Note: Must match C++ enum ProjectIcon
  44. {
  45. Folder, Mesh, Font, Texture, PlainText, ScriptCode, SpriteTexture, Shader, ShaderInclude, Material, Prefab, GUISkin,
  46. PhysicsMaterial, PhysicsMesh, AudioClip, AnimationClip
  47. }
  48. /// <summary>
  49. /// Types of icons that may be displayed in the animation editor window.
  50. /// </summary>
  51. public enum AnimationWindowIcon // Note: Must match C++ enum AnimationWindowIcon
  52. {
  53. Play, Record, FrameForward, FrameBack, AddKeyframe, AddEvent, Keyframe, Event
  54. };
  55. /// <summary>
  56. /// Types of icons that can be used for displaying types of log messages.
  57. /// </summary>
  58. public enum LogIcon // Note: Must match C++ enum LogMessageIcon
  59. {
  60. Info, Warning, Error
  61. }
  62. /// <summary>
  63. /// Types of icons used in various areas throughout the editor.
  64. /// </summary>
  65. public enum EditorIcon // Note: Must match C++ enum EditorIcon
  66. {
  67. X, Component, SceneObject
  68. }
  69. /// <summary>
  70. /// Contains various editor-specific resources that are always available.
  71. /// </summary>
  72. public static class EditorBuiltin
  73. {
  74. /// <summary>Returns text contained in the default "empty" shader.</summary>
  75. public static string EmptyShaderCode { get { return Internal_GetEmptyShaderCode(); } }
  76. /// <summary>Returns text contained in the default "empty" C# script.</summary>
  77. public static string EmptyCSScriptCode { get { return Internal_GetEmptyCSScriptCode(); } }
  78. /// <summary>
  79. /// Returns the default Font used in the editor.
  80. /// </summary>
  81. public static Font DefaultFont
  82. {
  83. get { return Internal_GetDefaultFont(); }
  84. }
  85. /// <summary>
  86. /// Retrieves an icon used for displaying an entry in the library window.
  87. /// </summary>
  88. /// <param name="icon">Type of the icon to retrieve.</param>
  89. /// <param name="size">Size of the icon to retrieve in pixels. This will be rounded
  90. /// to nearest available size.</param>
  91. /// <returns>Sprite texture of the icon.</returns>
  92. public static SpriteTexture GetLibraryItemIcon(LibraryItemIcon icon, int size)
  93. {
  94. return Internal_GetLibraryItemIcon(icon, size);
  95. }
  96. /// <summary>
  97. /// Retrieves an icon that may be displayed on the main window's toolbar.
  98. /// </summary>
  99. /// <param name="icon">Type of icon to retrieve.</param>
  100. /// <returns>Sprite texture of the icon.</returns>
  101. public static SpriteTexture GetToolbarIcon(ToolbarIcon icon)
  102. {
  103. return Internal_GetToolbarIcon(icon);
  104. }
  105. /// <summary>
  106. /// Retrieves an icon that may be displayed on the library window.
  107. /// </summary>
  108. /// <param name="icon">Type of icon to retrieve.</param>
  109. /// <returns>Sprite texture of the icon.</returns>
  110. public static SpriteTexture GetLibraryWindowIcon(LibraryWindowIcon icon)
  111. {
  112. return Internal_GetLibraryWindowIcon(icon);
  113. }
  114. /// <summary>
  115. /// Retrieves an icon that may be displayed on the inspector window.
  116. /// </summary>
  117. /// <param name="icon">Type of icon to retrieve.</param>
  118. /// <returns>Sprite texture of the icon.</returns>
  119. public static SpriteTexture GetInspectorWindowIcon(InspectorWindowIcon icon)
  120. {
  121. return Internal_GetInspectorWindowIcon(icon);
  122. }
  123. /// <summary>
  124. /// Retrieves an icon that may be displayed on the scene window.
  125. /// </summary>
  126. /// <param name="icon">Type of icon to retrieve.</param>
  127. /// <returns>Sprite textures of the icon.</returns>
  128. public static GUIContentImages GetSceneWindowIcon(SceneWindowIcon icon)
  129. {
  130. return Internal_GetSceneWindowIcon(icon);
  131. }
  132. /// <summary>
  133. /// Retrieves an icon that may be displayed on the animation window.
  134. /// </summary>
  135. /// <param name="icon">Type of icon to retrieve.</param>
  136. /// <returns>Sprite textures of the icon.</returns>
  137. public static GUIContentImages GetAnimationWindowIcon(AnimationWindowIcon icon)
  138. {
  139. return Internal_GetAnimationWindowIcon(icon);
  140. }
  141. /// <summary>
  142. /// Retrieves an icon that represents different types of log entries.
  143. /// </summary>
  144. /// <param name="icon">Type of icon to retrieve.</param>
  145. /// <param name="size">Size of the icon in pixels. Nearest available size will be returned.</param>
  146. /// <param name="dark">Controls should the dark or light version of the icon be returned.</param>
  147. /// <returns>Sprite texture of the icon.</returns>
  148. public static SpriteTexture GetLogIcon(LogIcon icon, int size, bool dark)
  149. {
  150. return Internal_GetLogIcon(icon, size, dark);
  151. }
  152. /// <summary>
  153. /// Retrieves an icon used throughout the editor.
  154. /// </summary>
  155. /// <param name="icon">Type of icon to retrieve.</param>
  156. /// <returns>Sprite texture of the icon.</returns>
  157. public static SpriteTexture GetEditorIcon(EditorIcon icon)
  158. {
  159. return Internal_GetEditorIcon(icon);
  160. }
  161. [MethodImpl(MethodImplOptions.InternalCall)]
  162. private static extern SpriteTexture Internal_GetLibraryItemIcon(LibraryItemIcon icon, int size);
  163. [MethodImpl(MethodImplOptions.InternalCall)]
  164. private static extern string Internal_GetEmptyShaderCode();
  165. [MethodImpl(MethodImplOptions.InternalCall)]
  166. private static extern string Internal_GetEmptyCSScriptCode();
  167. [MethodImpl(MethodImplOptions.InternalCall)]
  168. private static extern SpriteTexture Internal_GetToolbarIcon(ToolbarIcon icon);
  169. [MethodImpl(MethodImplOptions.InternalCall)]
  170. private static extern SpriteTexture Internal_GetLibraryWindowIcon(LibraryWindowIcon icon);
  171. [MethodImpl(MethodImplOptions.InternalCall)]
  172. private static extern SpriteTexture Internal_GetInspectorWindowIcon(InspectorWindowIcon icon);
  173. [MethodImpl(MethodImplOptions.InternalCall)]
  174. private static extern GUIContentImages Internal_GetSceneWindowIcon(SceneWindowIcon icon);
  175. [MethodImpl(MethodImplOptions.InternalCall)]
  176. private static extern GUIContentImages Internal_GetAnimationWindowIcon(AnimationWindowIcon icon);
  177. [MethodImpl(MethodImplOptions.InternalCall)]
  178. private static extern SpriteTexture Internal_GetLogIcon(LogIcon icon, int size, bool dark);
  179. [MethodImpl(MethodImplOptions.InternalCall)]
  180. private static extern SpriteTexture Internal_GetEditorIcon(EditorIcon icon);
  181. [MethodImpl(MethodImplOptions.InternalCall)]
  182. private static extern Font Internal_GetDefaultFont();
  183. }
  184. /** @} */
  185. }