2
0

IGUISkin.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #pragma once
  5. #include "IReferenceCounted.h"
  6. #include "EGUIAlignment.h"
  7. #include "SColor.h"
  8. #include "rect.h"
  9. namespace irr
  10. {
  11. namespace gui
  12. {
  13. class IGUIFont;
  14. class IGUISpriteBank;
  15. class IGUIElement;
  16. //! Enumeration of available default skins.
  17. /** To set one of the skins, use the following code, for example to set
  18. the Windows classic skin:
  19. \code
  20. gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC);
  21. environment->setSkin(newskin);
  22. newskin->drop();
  23. \endcode
  24. */
  25. enum EGUI_SKIN_TYPE
  26. {
  27. //! Default windows look and feel
  28. EGST_WINDOWS_CLASSIC = 0,
  29. //! Like EGST_WINDOWS_CLASSIC, but with metallic shaded windows and buttons
  30. EGST_WINDOWS_METALLIC,
  31. //! Burning's skin
  32. EGST_BURNING_SKIN,
  33. //! An unknown skin, not serializable at present
  34. EGST_UNKNOWN,
  35. //! this value is not used, it only specifies the number of skin types
  36. EGST_COUNT
  37. };
  38. //! Names for gui element types
  39. const c8 *const GUISkinTypeNames[EGST_COUNT + 1] = {
  40. "windowsClassic",
  41. "windowsMetallic",
  42. "burning",
  43. "unknown",
  44. 0,
  45. };
  46. //! Enumeration for skin colors
  47. enum EGUI_DEFAULT_COLOR
  48. {
  49. //! Dark shadow for three-dimensional display elements.
  50. EGDC_3D_DARK_SHADOW = 0,
  51. //! Shadow color for three-dimensional display elements (for edges facing away from the light source).
  52. EGDC_3D_SHADOW,
  53. //! Face color for three-dimensional display elements and for dialog box backgrounds.
  54. EGDC_3D_FACE,
  55. //! Highlight color for three-dimensional display elements (for edges facing the light source.)
  56. EGDC_3D_HIGH_LIGHT,
  57. //! Light color for three-dimensional display elements (for edges facing the light source.)
  58. EGDC_3D_LIGHT,
  59. //! Active window border.
  60. EGDC_ACTIVE_BORDER,
  61. //! Active window title bar text.
  62. EGDC_ACTIVE_CAPTION,
  63. //! Background color of multiple document interface (MDI) applications.
  64. EGDC_APP_WORKSPACE,
  65. //! Text on a button
  66. EGDC_BUTTON_TEXT,
  67. //! Grayed (disabled) text.
  68. EGDC_GRAY_TEXT,
  69. //! Item(s) selected in a control.
  70. EGDC_HIGH_LIGHT,
  71. //! Text of item(s) selected in a control.
  72. EGDC_HIGH_LIGHT_TEXT,
  73. //! Inactive window border.
  74. EGDC_INACTIVE_BORDER,
  75. //! Inactive window caption.
  76. EGDC_INACTIVE_CAPTION,
  77. //! Tool tip text color
  78. EGDC_TOOLTIP,
  79. //! Tool tip background color
  80. EGDC_TOOLTIP_BACKGROUND,
  81. //! Scrollbar gray area
  82. EGDC_SCROLLBAR,
  83. //! Window background
  84. EGDC_WINDOW,
  85. //! Window symbols like on close buttons, scroll bars and check boxes
  86. EGDC_WINDOW_SYMBOL,
  87. //! Icons in a list or tree
  88. EGDC_ICON,
  89. //! Selected icons in a list or tree
  90. EGDC_ICON_HIGH_LIGHT,
  91. //! Grayed (disabled) window symbols like on close buttons, scroll bars and check boxes
  92. EGDC_GRAY_WINDOW_SYMBOL,
  93. //! Window background for editable field (editbox, checkbox-field)
  94. EGDC_EDITABLE,
  95. //! Grayed (disabled) window background for editable field (editbox, checkbox-field)
  96. EGDC_GRAY_EDITABLE,
  97. //! Show focus of window background for editable field (editbox or when checkbox-field is pressed)
  98. EGDC_FOCUSED_EDITABLE,
  99. //! this value is not used, it only specifies the amount of default colors
  100. //! available.
  101. EGDC_COUNT
  102. };
  103. //! Names for default skin colors
  104. const c8 *const GUISkinColorNames[EGDC_COUNT + 1] = {
  105. "3DDarkShadow",
  106. "3DShadow",
  107. "3DFace",
  108. "3DHighlight",
  109. "3DLight",
  110. "ActiveBorder",
  111. "ActiveCaption",
  112. "AppWorkspace",
  113. "ButtonText",
  114. "GrayText",
  115. "Highlight",
  116. "HighlightText",
  117. "InactiveBorder",
  118. "InactiveCaption",
  119. "ToolTip",
  120. "ToolTipBackground",
  121. "ScrollBar",
  122. "Window",
  123. "WindowSymbol",
  124. "Icon",
  125. "IconHighlight",
  126. "GrayWindowSymbol",
  127. "Editable",
  128. "GrayEditable",
  129. "FocusedEditable",
  130. 0,
  131. };
  132. //! Enumeration for default sizes.
  133. enum EGUI_DEFAULT_SIZE
  134. {
  135. //! default with / height of scrollbar. Also width of drop-down button in comboboxes.
  136. EGDS_SCROLLBAR_SIZE = 0,
  137. //! height of menu
  138. EGDS_MENU_HEIGHT,
  139. //! width and height of a window titlebar button (like minimize/maximize/close buttons). The titlebar height is also calculated from that.
  140. EGDS_WINDOW_BUTTON_WIDTH,
  141. //! width of a checkbox check
  142. EGDS_CHECK_BOX_WIDTH,
  143. //! \deprecated This may be removed by Irrlicht 1.9
  144. EGDS_MESSAGE_BOX_WIDTH,
  145. //! \deprecated This may be removed by Irrlicht 1.9
  146. EGDS_MESSAGE_BOX_HEIGHT,
  147. //! width of a default button
  148. EGDS_BUTTON_WIDTH,
  149. //! height of a default button (OK and cancel buttons)
  150. EGDS_BUTTON_HEIGHT,
  151. //! distance for text from background
  152. EGDS_TEXT_DISTANCE_X,
  153. //! distance for text from background
  154. EGDS_TEXT_DISTANCE_Y,
  155. //! distance for text in the title bar, from the left of the window rect
  156. EGDS_TITLEBARTEXT_DISTANCE_X,
  157. //! distance for text in the title bar, from the top of the window rect
  158. EGDS_TITLEBARTEXT_DISTANCE_Y,
  159. //! free space in a messagebox between borders and contents on all sides
  160. EGDS_MESSAGE_BOX_GAP_SPACE,
  161. //! minimal space to reserve for messagebox text-width
  162. EGDS_MESSAGE_BOX_MIN_TEXT_WIDTH,
  163. //! maximal space to reserve for messagebox text-width
  164. EGDS_MESSAGE_BOX_MAX_TEXT_WIDTH,
  165. //! minimal space to reserve for messagebox text-height
  166. EGDS_MESSAGE_BOX_MIN_TEXT_HEIGHT,
  167. //! maximal space to reserve for messagebox text-height
  168. EGDS_MESSAGE_BOX_MAX_TEXT_HEIGHT,
  169. //! pixels to move an unscaled button image to the right when a button is pressed and the unpressed image looks identical
  170. EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X,
  171. //! pixels to move an unscaled button image down when a button is pressed and the unpressed image looks identical
  172. EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y,
  173. //! pixels to move the button text to the right when a button is pressed
  174. EGDS_BUTTON_PRESSED_TEXT_OFFSET_X,
  175. //! pixels to move the button text down when a button is pressed
  176. EGDS_BUTTON_PRESSED_TEXT_OFFSET_Y,
  177. //! pixels to move an unscaled button sprite to the right when a button is pressed
  178. EGDS_BUTTON_PRESSED_SPRITE_OFFSET_X,
  179. //! pixels to move an unscaled button sprite down when a button is pressed
  180. EGDS_BUTTON_PRESSED_SPRITE_OFFSET_Y,
  181. //! this value is not used, it only specifies the amount of default sizes
  182. //! available.
  183. EGDS_COUNT
  184. };
  185. //! Names for default skin sizes
  186. const c8 *const GUISkinSizeNames[EGDS_COUNT + 1] = {
  187. "ScrollBarSize",
  188. "MenuHeight",
  189. "WindowButtonWidth",
  190. "CheckBoxWidth",
  191. "MessageBoxWidth",
  192. "MessageBoxHeight",
  193. "ButtonWidth",
  194. "ButtonHeight",
  195. "TextDistanceX",
  196. "TextDistanceY",
  197. "TitleBarTextX",
  198. "TitleBarTextY",
  199. "MessageBoxGapSpace",
  200. "MessageBoxMinTextWidth",
  201. "MessageBoxMaxTextWidth",
  202. "MessageBoxMinTextHeight",
  203. "MessageBoxMaxTextHeight",
  204. "ButtonPressedImageOffsetX",
  205. "ButtonPressedImageOffsetY",
  206. "ButtonPressedTextOffsetX",
  207. "ButtonPressedTextOffsetY",
  208. "ButtonPressedSpriteOffsetX",
  209. "ButtonPressedSpriteOffsetY",
  210. 0,
  211. };
  212. enum EGUI_DEFAULT_TEXT
  213. {
  214. //! Text for the OK button on a message box
  215. EGDT_MSG_BOX_OK = 0,
  216. //! Text for the Cancel button on a message box
  217. EGDT_MSG_BOX_CANCEL,
  218. //! Text for the Yes button on a message box
  219. EGDT_MSG_BOX_YES,
  220. //! Text for the No button on a message box
  221. EGDT_MSG_BOX_NO,
  222. //! Tooltip text for window close button
  223. EGDT_WINDOW_CLOSE,
  224. //! Tooltip text for window maximize button
  225. EGDT_WINDOW_MAXIMIZE,
  226. //! Tooltip text for window minimize button
  227. EGDT_WINDOW_MINIMIZE,
  228. //! Tooltip text for window restore button
  229. EGDT_WINDOW_RESTORE,
  230. //! this value is not used, it only specifies the number of default texts
  231. EGDT_COUNT
  232. };
  233. //! Names for default skin sizes
  234. const c8 *const GUISkinTextNames[EGDT_COUNT + 1] = {
  235. "MessageBoxOkay",
  236. "MessageBoxCancel",
  237. "MessageBoxYes",
  238. "MessageBoxNo",
  239. "WindowButtonClose",
  240. "WindowButtonMaximize",
  241. "WindowButtonMinimize",
  242. "WindowButtonRestore",
  243. 0,
  244. };
  245. //! Customizable symbols for GUI
  246. enum EGUI_DEFAULT_ICON
  247. {
  248. //! maximize window button
  249. EGDI_WINDOW_MAXIMIZE = 0,
  250. //! restore window button
  251. EGDI_WINDOW_RESTORE,
  252. //! close window button
  253. EGDI_WINDOW_CLOSE,
  254. //! minimize window button
  255. EGDI_WINDOW_MINIMIZE,
  256. //! resize icon for bottom right corner of a window
  257. EGDI_WINDOW_RESIZE,
  258. //! scroll bar up button
  259. EGDI_CURSOR_UP,
  260. //! scroll bar down button
  261. EGDI_CURSOR_DOWN,
  262. //! scroll bar left button
  263. EGDI_CURSOR_LEFT,
  264. //! scroll bar right button
  265. EGDI_CURSOR_RIGHT,
  266. //! icon for menu children
  267. EGDI_MENU_MORE,
  268. //! tick for checkbox
  269. EGDI_CHECK_BOX_CHECKED,
  270. //! down arrow for dropdown menus
  271. EGDI_DROP_DOWN,
  272. //! smaller up arrow
  273. EGDI_SMALL_CURSOR_UP,
  274. //! smaller down arrow
  275. EGDI_SMALL_CURSOR_DOWN,
  276. //! selection dot in a radio button
  277. EGDI_RADIO_BUTTON_CHECKED,
  278. //! << icon indicating there is more content to the left
  279. EGDI_MORE_LEFT,
  280. //! >> icon indicating that there is more content to the right
  281. EGDI_MORE_RIGHT,
  282. //! icon indicating that there is more content above
  283. EGDI_MORE_UP,
  284. //! icon indicating that there is more content below
  285. EGDI_MORE_DOWN,
  286. //! plus icon for trees
  287. EGDI_EXPAND,
  288. //! minus icon for trees
  289. EGDI_COLLAPSE,
  290. //! file icon for file selection
  291. EGDI_FILE,
  292. //! folder icon for file selection
  293. EGDI_DIRECTORY,
  294. //! value not used, it only specifies the number of icons
  295. EGDI_COUNT
  296. };
  297. const c8 *const GUISkinIconNames[EGDI_COUNT + 1] = {
  298. "windowMaximize",
  299. "windowRestore",
  300. "windowClose",
  301. "windowMinimize",
  302. "windowResize",
  303. "cursorUp",
  304. "cursorDown",
  305. "cursorLeft",
  306. "cursorRight",
  307. "menuMore",
  308. "checkBoxChecked",
  309. "dropDown",
  310. "smallCursorUp",
  311. "smallCursorDown",
  312. "radioButtonChecked",
  313. "moreLeft",
  314. "moreRight",
  315. "moreUp",
  316. "moreDown",
  317. "expand",
  318. "collapse",
  319. "file",
  320. "directory",
  321. 0,
  322. };
  323. // Customizable fonts
  324. enum EGUI_DEFAULT_FONT
  325. {
  326. //! For static text, edit boxes, lists and most other places
  327. EGDF_DEFAULT = 0,
  328. //! Font for buttons
  329. EGDF_BUTTON,
  330. //! Font for window title bars
  331. EGDF_WINDOW,
  332. //! Font for menu items
  333. EGDF_MENU,
  334. //! Font for tooltips
  335. EGDF_TOOLTIP,
  336. //! this value is not used, it only specifies the amount of default fonts
  337. //! available.
  338. EGDF_COUNT
  339. };
  340. const c8 *const GUISkinFontNames[EGDF_COUNT + 1] = {
  341. "defaultFont",
  342. "buttonFont",
  343. "windowFont",
  344. "menuFont",
  345. "tooltipFont",
  346. 0,
  347. };
  348. //! A skin modifies the look of the GUI elements.
  349. class IGUISkin : virtual public IReferenceCounted
  350. {
  351. public:
  352. //! returns display density scaling factor
  353. virtual float getScale() const = 0;
  354. //! sets display density scaling factor
  355. virtual void setScale(float scale) = 0;
  356. //! returns default color
  357. virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const = 0;
  358. //! sets a default color
  359. virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) = 0;
  360. //! returns size for the given size type
  361. virtual s32 getSize(EGUI_DEFAULT_SIZE size) const = 0;
  362. //! Returns a default text.
  363. /** For example for Message box button captions:
  364. "OK", "Cancel", "Yes", "No" and so on. */
  365. virtual const wchar_t *getDefaultText(EGUI_DEFAULT_TEXT text) const = 0;
  366. //! Sets a default text.
  367. /** For example for Message box button captions:
  368. "OK", "Cancel", "Yes", "No" and so on. */
  369. virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t *newText) = 0;
  370. //! sets a default size
  371. virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size) = 0;
  372. //! returns the default font
  373. virtual IGUIFont *getFont(EGUI_DEFAULT_FONT which = EGDF_DEFAULT) const = 0;
  374. //! sets a default font
  375. virtual void setFont(IGUIFont *font, EGUI_DEFAULT_FONT which = EGDF_DEFAULT) = 0;
  376. //! returns the sprite bank
  377. virtual IGUISpriteBank *getSpriteBank() const = 0;
  378. //! sets the sprite bank
  379. virtual void setSpriteBank(IGUISpriteBank *bank) = 0;
  380. //! Returns a default icon
  381. /** Returns the sprite index within the sprite bank */
  382. virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const = 0;
  383. //! Sets a default icon
  384. /** Sets the sprite index used for drawing icons like arrows,
  385. close buttons and ticks in checkboxes
  386. \param icon: Enum specifying which icon to change
  387. \param index: The sprite index used to draw this icon */
  388. virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) = 0;
  389. //! draws a standard 3d button pane
  390. /** Used for drawing for example buttons in normal state.
  391. It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
  392. EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
  393. \param element: Pointer to the element which wishes to draw this. This parameter
  394. is usually not used by IGUISkin, but can be used for example by more complex
  395. implementations to find out how to draw the part exactly.
  396. \param rect: Defining area where to draw.
  397. \param clip: Clip area. */
  398. virtual void draw3DButtonPaneStandard(IGUIElement *element,
  399. const core::rect<s32> &rect,
  400. const core::rect<s32> *clip = 0) = 0;
  401. virtual void drawColored3DButtonPaneStandard(IGUIElement* element,
  402. const core::rect<s32>& rect,
  403. const core::rect<s32>* clip=0,
  404. const video::SColor* colors=0) = 0;
  405. //! draws a pressed 3d button pane
  406. /** Used for drawing for example buttons in pressed state.
  407. It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
  408. EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
  409. \param element: Pointer to the element which wishes to draw this. This parameter
  410. is usually not used by IGUISkin, but can be used for example by more complex
  411. implementations to find out how to draw the part exactly.
  412. \param rect: Defining area where to draw.
  413. \param clip: Clip area. */
  414. virtual void draw3DButtonPanePressed(IGUIElement *element,
  415. const core::rect<s32> &rect,
  416. const core::rect<s32> *clip = 0) = 0;
  417. virtual void drawColored3DButtonPanePressed(IGUIElement* element,
  418. const core::rect<s32>& rect,
  419. const core::rect<s32>* clip=0,
  420. const video::SColor* colors=0) = 0;
  421. //! draws a sunken 3d pane
  422. /** Used for drawing the background of edit, combo or check boxes.
  423. \param element: Pointer to the element which wishes to draw this. This parameter
  424. is usually not used by IGUISkin, but can be used for example by more complex
  425. implementations to find out how to draw the part exactly.
  426. \param bgcolor: Background color.
  427. \param flat: Specifies if the sunken pane should be flat or displayed as sunken
  428. deep into the ground.
  429. \param fillBackGround: Specifies if the background should be filled with the background
  430. color or not be drawn at all.
  431. \param rect: Defining area where to draw.
  432. \param clip: Clip area. */
  433. virtual void draw3DSunkenPane(IGUIElement *element,
  434. video::SColor bgcolor, bool flat, bool fillBackGround,
  435. const core::rect<s32> &rect,
  436. const core::rect<s32> *clip = 0) = 0;
  437. //! draws a window background
  438. /** Used for drawing the background of dialogs and windows.
  439. \param element: Pointer to the element which wishes to draw this. This parameter
  440. is usually not used by IGUISkin, but can be used for example by more complex
  441. implementations to find out how to draw the part exactly.
  442. \param titleBarColor: Title color.
  443. \param drawTitleBar: True to enable title drawing.
  444. \param rect: Defining area where to draw.
  445. \param clip: Clip area.
  446. \param checkClientArea: When set to non-null the function will not draw anything,
  447. but will instead return the clientArea which can be used for drawing by the calling window.
  448. That is the area without borders and without titlebar.
  449. \return Returns rect where it would be good to draw title bar text. This will
  450. work even when checkClientArea is set to a non-null value.*/
  451. virtual core::rect<s32> draw3DWindowBackground(IGUIElement *element,
  452. bool drawTitleBar, video::SColor titleBarColor,
  453. const core::rect<s32> &rect,
  454. const core::rect<s32> *clip = 0,
  455. core::rect<s32> *checkClientArea = 0) = 0;
  456. //! draws a standard 3d menu pane
  457. /** Used for drawing for menus and context menus.
  458. It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
  459. EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
  460. \param element: Pointer to the element which wishes to draw this. This parameter
  461. is usually not used by IGUISkin, but can be used for example by more complex
  462. implementations to find out how to draw the part exactly.
  463. \param rect: Defining area where to draw.
  464. \param clip: Clip area. */
  465. virtual void draw3DMenuPane(IGUIElement *element,
  466. const core::rect<s32> &rect,
  467. const core::rect<s32> *clip = 0) = 0;
  468. //! draws a standard 3d tool bar
  469. /** Used for drawing for toolbars and menus.
  470. \param element: Pointer to the element which wishes to draw this. This parameter
  471. is usually not used by IGUISkin, but can be used for example by more complex
  472. implementations to find out how to draw the part exactly.
  473. \param rect: Defining area where to draw.
  474. \param clip: Clip area. */
  475. virtual void draw3DToolBar(IGUIElement *element,
  476. const core::rect<s32> &rect,
  477. const core::rect<s32> *clip = 0) = 0;
  478. //! draws a tab button
  479. /** Used for drawing for tab buttons on top of tabs.
  480. \param element: Pointer to the element which wishes to draw this. This parameter
  481. is usually not used by IGUISkin, but can be used for example by more complex
  482. implementations to find out how to draw the part exactly.
  483. \param active: Specifies if the tab is currently active.
  484. \param rect: Defining area where to draw.
  485. \param clip: Clip area.
  486. \param alignment Alignment of GUI element. */
  487. virtual void draw3DTabButton(IGUIElement *element, bool active,
  488. const core::rect<s32> &rect, const core::rect<s32> *clip = 0, gui::EGUI_ALIGNMENT alignment = EGUIA_UPPERLEFT) = 0;
  489. //! draws a tab control body
  490. /** \param element: Pointer to the element which wishes to draw this. This parameter
  491. is usually not used by IGUISkin, but can be used for example by more complex
  492. implementations to find out how to draw the part exactly.
  493. \param border: Specifies if the border should be drawn.
  494. \param background: Specifies if the background should be drawn.
  495. \param rect: Defining area where to draw.
  496. \param clip: Clip area.
  497. \param tabHeight Height of tab.
  498. \param alignment Alignment of GUI element. */
  499. virtual void draw3DTabBody(IGUIElement *element, bool border, bool background,
  500. const core::rect<s32> &rect, const core::rect<s32> *clip = 0, s32 tabHeight = -1, gui::EGUI_ALIGNMENT alignment = EGUIA_UPPERLEFT) = 0;
  501. //! draws an icon, usually from the skin's sprite bank
  502. /** \param element: Pointer to the element which wishes to draw this icon.
  503. This parameter is usually not used by IGUISkin, but can be used for example
  504. by more complex implementations to find out how to draw the part exactly.
  505. \param icon: Specifies the icon to be drawn.
  506. \param position: The position to draw the icon
  507. \param starttime: The time at the start of the animation
  508. \param currenttime: The present time, used to calculate the frame number
  509. \param loop: Whether the animation should loop or not
  510. \param clip: Clip area. */
  511. virtual void drawIcon(IGUIElement *element, EGUI_DEFAULT_ICON icon,
  512. const core::position2di position, u32 starttime = 0, u32 currenttime = 0,
  513. bool loop = false, const core::rect<s32> *clip = 0) = 0;
  514. //! draws a 2d rectangle.
  515. /** \param element: Pointer to the element which wishes to draw this icon.
  516. This parameter is usually not used by IGUISkin, but can be used for example
  517. by more complex implementations to find out how to draw the part exactly.
  518. \param color: Color of the rectangle to draw. The alpha component specifies how
  519. transparent the rectangle will be.
  520. \param pos: Position of the rectangle.
  521. \param clip: Pointer to rectangle against which the rectangle will be clipped.
  522. If the pointer is null, no clipping will be performed. */
  523. virtual void draw2DRectangle(IGUIElement *element, const video::SColor &color,
  524. const core::rect<s32> &pos, const core::rect<s32> *clip = 0) = 0;
  525. //! get the type of this skin
  526. virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; }
  527. };
  528. } // end namespace gui
  529. } // end namespace irr