ColorPicker.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ColorPicker" inherits="BoxContainer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. Color picker control.
  5. </brief_description>
  6. <description>
  7. Displays a color picker widget. Useful for selecting a color from an RGB/RGBA colorspace.
  8. [b]Note:[/b] This control is the color picker widget itself. You can use a [ColorPickerButton] instead if you need a button that brings up a [ColorPicker] in a pop-up.
  9. </description>
  10. <tutorials>
  11. <link title="Tween Demo">https://godotengine.org/asset-library/asset/146</link>
  12. </tutorials>
  13. <methods>
  14. <method name="add_preset">
  15. <return type="void" />
  16. <argument index="0" name="color" type="Color" />
  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. <argument index="0" name="color" type="Color" />
  25. <description>
  26. Removes the given color from the list of color presets of this color picker.
  27. </description>
  28. </method>
  29. <method name="get_presets" qualifiers="const">
  30. <return type="PoolColorArray" />
  31. <description>
  32. Returns the list of colors in the presets of the color picker.
  33. </description>
  34. </method>
  35. </methods>
  36. <members>
  37. <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color( 1, 1, 1, 1 )">
  38. The currently selected color.
  39. </member>
  40. <member name="deferred_mode" type="bool" setter="set_deferred_mode" getter="is_deferred_mode" default="false">
  41. 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).
  42. </member>
  43. <member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true">
  44. If [code]true[/code], shows an alpha channel slider (opacity).
  45. </member>
  46. <member name="hsv_mode" type="bool" setter="set_hsv_mode" getter="is_hsv_mode" default="false">
  47. If [code]true[/code], allows editing the color with Hue/Saturation/Value sliders.
  48. [b]Note:[/b] Cannot be enabled if raw mode is on.
  49. </member>
  50. <member name="presets_enabled" type="bool" setter="set_presets_enabled" getter="are_presets_enabled" default="true">
  51. If [code]true[/code], the "add preset" button is enabled.
  52. </member>
  53. <member name="presets_visible" type="bool" setter="set_presets_visible" getter="are_presets_visible" default="true">
  54. If [code]true[/code], saved color presets are visible.
  55. </member>
  56. <member name="raw_mode" type="bool" setter="set_raw_mode" getter="is_raw_mode" default="false">
  57. 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).
  58. [b]Note:[/b] Cannot be enabled if HSV mode is on.
  59. </member>
  60. </members>
  61. <signals>
  62. <signal name="color_changed">
  63. <argument index="0" name="color" type="Color" />
  64. <description>
  65. Emitted when the color is changed.
  66. </description>
  67. </signal>
  68. <signal name="preset_added">
  69. <argument index="0" name="color" type="Color" />
  70. <description>
  71. Emitted when a preset is added.
  72. </description>
  73. </signal>
  74. <signal name="preset_removed">
  75. <argument index="0" name="color" type="Color" />
  76. <description>
  77. Emitted when a preset is removed.
  78. </description>
  79. </signal>
  80. </signals>
  81. <constants>
  82. </constants>
  83. <theme_items>
  84. <theme_item name="h_width" data_type="constant" type="int" default="30">
  85. The width of the hue selection slider.
  86. </theme_item>
  87. <theme_item name="label_width" data_type="constant" type="int" default="10">
  88. </theme_item>
  89. <theme_item name="margin" data_type="constant" type="int" default="4">
  90. The margin around the [ColorPicker].
  91. </theme_item>
  92. <theme_item name="sv_height" data_type="constant" type="int" default="256">
  93. The height of the saturation-value selection box.
  94. </theme_item>
  95. <theme_item name="sv_width" data_type="constant" type="int" default="256">
  96. The width of the saturation-value selection box.
  97. </theme_item>
  98. <theme_item name="add_preset" data_type="icon" type="Texture">
  99. The icon for the "Add Preset" button.
  100. </theme_item>
  101. <theme_item name="color_hue" data_type="icon" type="Texture">
  102. Custom texture for the hue selection slider on the right.
  103. </theme_item>
  104. <theme_item name="color_sample" data_type="icon" type="Texture">
  105. </theme_item>
  106. <theme_item name="overbright_indicator" data_type="icon" 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" data_type="icon" type="Texture">
  110. </theme_item>
  111. <theme_item name="screen_picker" data_type="icon" type="Texture">
  112. The icon for the screen color picker button.
  113. </theme_item>
  114. </theme_items>
  115. </class>