ColorPicker.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ColorPicker" inherits="BoxContainer" version="3.2">
  3. <brief_description>
  4. Color picker control.
  5. </brief_description>
  6. <description>
  7. [Control] node displaying a color picker widget. It's useful for selecting a color from an RGB/RGBA colorspace.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="add_preset">
  13. <return type="void">
  14. </return>
  15. <argument index="0" name="color" type="Color">
  16. </argument>
  17. <description>
  18. Adds the given color to a list of color presets. The presets are displayed in the color picker and the user will be able to select them.
  19. [b]Note:[/b] the presets list is only for [i]this[/i] color picker.
  20. </description>
  21. </method>
  22. <method name="erase_preset">
  23. <return type="void">
  24. </return>
  25. <argument index="0" name="color" type="Color">
  26. </argument>
  27. <description>
  28. Removes the given color from the list of color presets of this color picker.
  29. </description>
  30. </method>
  31. <method name="get_presets" qualifiers="const">
  32. <return type="PoolColorArray">
  33. </return>
  34. <description>
  35. Returns the list of colors in the presets of the color picker.
  36. </description>
  37. </method>
  38. </methods>
  39. <members>
  40. <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color( 1, 1, 1, 1 )">
  41. The currently selected color.
  42. </member>
  43. <member name="deferred_mode" type="bool" setter="set_deferred_mode" getter="is_deferred_mode" default="false">
  44. If [code]true[/code], the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues).
  45. </member>
  46. <member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true">
  47. If [code]true[/code], shows an alpha channel slider (transparency).
  48. </member>
  49. <member name="hsv_mode" type="bool" setter="set_hsv_mode" getter="is_hsv_mode" default="false">
  50. If [code]true[/code], allows editing the color with Hue/Saturation/Value sliders.
  51. [b]Note:[/b] Cannot be enabled if raw mode is on.
  52. </member>
  53. <member name="presets_enabled" type="bool" setter="set_presets_enabled" getter="are_presets_enabled" default="true">
  54. If [code]true[/code], the "add preset" button is enabled.
  55. </member>
  56. <member name="presets_visible" type="bool" setter="set_presets_visible" getter="are_presets_visible" default="true">
  57. If [code]true[/code], saved color presets are visible.
  58. </member>
  59. <member name="raw_mode" type="bool" setter="set_raw_mode" getter="is_raw_mode" default="false">
  60. If [code]true[/code], allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR).
  61. [b]Note:[/b] Cannot be enabled if HSV mode is on.
  62. </member>
  63. </members>
  64. <signals>
  65. <signal name="color_changed">
  66. <argument index="0" name="color" type="Color">
  67. </argument>
  68. <description>
  69. Emitted when the color is changed.
  70. </description>
  71. </signal>
  72. <signal name="preset_added">
  73. <argument index="0" name="color" type="Color">
  74. </argument>
  75. <description>
  76. Emitted when a preset is added.
  77. </description>
  78. </signal>
  79. <signal name="preset_removed">
  80. <argument index="0" name="color" type="Color">
  81. </argument>
  82. <description>
  83. Emitted when a preset is removed.
  84. </description>
  85. </signal>
  86. </signals>
  87. <constants>
  88. </constants>
  89. <theme_items>
  90. <theme_item name="add_preset" type="Texture">
  91. The icon for the "Add Preset" button.
  92. </theme_item>
  93. <theme_item name="color_hue" type="Texture">
  94. Custom texture for the hue selection slider on the right.
  95. </theme_item>
  96. <theme_item name="color_sample" type="Texture">
  97. </theme_item>
  98. <theme_item name="h_width" type="int" default="30">
  99. The width of the hue selection slider.
  100. </theme_item>
  101. <theme_item name="label_width" type="int" default="10">
  102. </theme_item>
  103. <theme_item name="margin" type="int" default="4">
  104. The margin around the [ColorPicker].
  105. </theme_item>
  106. <theme_item name="overbright_indicator" type="Texture">
  107. The indicator used to signalize that the color value is outside the 0-1 range.
  108. </theme_item>
  109. <theme_item name="preset_bg" type="Texture">
  110. </theme_item>
  111. <theme_item name="screen_picker" type="Texture">
  112. The icon for the screen color picker button.
  113. </theme_item>
  114. <theme_item name="sv_height" type="int" default="256">
  115. The height of the saturation-value selection box.
  116. </theme_item>
  117. <theme_item name="sv_width" type="int" default="256">
  118. The width of the saturation-value selection box.
  119. </theme_item>
  120. </theme_items>
  121. </class>