IGUISkin.h 20 KB

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