ColorPicker.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ColorPicker" inherits="BoxContainer" version="3.3">
  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. <link title="Tween Demo">https://godotengine.org/asset-library/asset/146</link>
  11. </tutorials>
  12. <methods>
  13. <method name="add_preset">
  14. <return type="void">
  15. </return>
  16. <argument index="0" name="color" type="Color">
  17. </argument>
  18. <description>
  19. 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.
  20. [b]Note:[/b] the presets list is only for [i]this[/i] color picker.
  21. </description>
  22. </method>
  23. <method name="erase_preset">
  24. <return type="void">
  25. </return>
  26. <argument index="0" name="color" type="Color">
  27. </argument>
  28. <description>
  29. Removes the given color from the list of color presets of this color picker.
  30. </description>
  31. </method>
  32. <method name="get_presets" qualifiers="const">
  33. <return type="PoolColorArray">
  34. </return>
  35. <description>
  36. Returns the list of colors in the presets of the color picker.
  37. </description>
  38. </method>
  39. </methods>
  40. <members>
  41. <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color( 1, 1, 1, 1 )">
  42. The currently selected color.
  43. </member>
  44. <member name="deferred_mode" type="bool" setter="set_deferred_mode" getter="is_deferred_mode" default="false">
  45. 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).
  46. </member>
  47. <member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true">
  48. If [code]true[/code], shows an alpha channel slider (transparency).
  49. </member>
  50. <member name="hsv_mode" type="bool" setter="set_hsv_mode" getter="is_hsv_mode" default="false">
  51. If [code]true[/code], allows editing the color with Hue/Saturation/Value sliders.
  52. [b]Note:[/b] Cannot be enabled if raw mode is on.
  53. </member>
  54. <member name="presets_enabled" type="bool" setter="set_presets_enabled" getter="are_presets_enabled" default="true">
  55. If [code]true[/code], the "add preset" button is enabled.
  56. </member>
  57. <member name="presets_visible" type="bool" setter="set_presets_visible" getter="are_presets_visible" default="true">
  58. If [code]true[/code], saved color presets are visible.
  59. </member>
  60. <member name="raw_mode" type="bool" setter="set_raw_mode" getter="is_raw_mode" default="false">
  61. 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).
  62. [b]Note:[/b] Cannot be enabled if HSV mode is on.
  63. </member>
  64. </members>
  65. <signals>
  66. <signal name="color_changed">
  67. <argument index="0" name="color" type="Color">
  68. </argument>
  69. <description>
  70. Emitted when the color is changed.
  71. </description>
  72. </signal>
  73. <signal name="preset_added">
  74. <argument index="0" name="color" type="Color">
  75. </argument>
  76. <description>
  77. Emitted when a preset is added.
  78. </description>
  79. </signal>
  80. <signal name="preset_removed">
  81. <argument index="0" name="color" type="Color">
  82. </argument>
  83. <description>
  84. Emitted when a preset is removed.
  85. </description>
  86. </signal>
  87. </signals>
  88. <constants>
  89. </constants>
  90. <theme_items>
  91. <theme_item name="add_preset" type="Texture">
  92. The icon for the "Add Preset" button.
  93. </theme_item>
  94. <theme_item name="color_hue" type="Texture">
  95. Custom texture for the hue selection slider on the right.
  96. </theme_item>
  97. <theme_item name="color_sample" type="Texture">
  98. </theme_item>
  99. <theme_item name="h_width" type="int" default="30">
  100. The width of the hue selection slider.
  101. </theme_item>
  102. <theme_item name="label_width" type="int" default="10">
  103. </theme_item>
  104. <theme_item name="margin" type="int" default="4">
  105. The margin around the [ColorPicker].
  106. </theme_item>
  107. <theme_item name="overbright_indicator" type="Texture">
  108. The indicator used to signalize that the color value is outside the 0-1 range.
  109. </theme_item>
  110. <theme_item name="preset_bg" type="Texture">
  111. </theme_item>
  112. <theme_item name="screen_picker" type="Texture">
  113. The icon for the screen color picker button.
  114. </theme_item>
  115. <theme_item name="sv_height" type="int" default="256">
  116. The height of the saturation-value selection box.
  117. </theme_item>
  118. <theme_item name="sv_width" type="int" default="256">
  119. The width of the saturation-value selection box.
  120. </theme_item>
  121. </theme_items>
  122. </class>