class_colorpickerbutton.rst 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ColorPickerButton.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ColorPickerButton:
  6. ColorPickerButton
  7. =================
  8. **Inherits:** :ref:`Button<class_Button>` **<** :ref:`BaseButton<class_BaseButton>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Button that pops out a :ref:`ColorPicker<class_ColorPicker>`.
  10. Description
  11. -----------
  12. Encapsulates a :ref:`ColorPicker<class_ColorPicker>` making it accessible by pressing a button. Pressing the button will toggle the :ref:`ColorPicker<class_ColorPicker>` visibility.
  13. See also :ref:`BaseButton<class_BaseButton>` which contains common properties and methods associated with this node.
  14. Tutorials
  15. ---------
  16. - `GUI Drag And Drop Demo <https://godotengine.org/asset-library/asset/133>`_
  17. - `2D GD Paint Demo <https://godotengine.org/asset-library/asset/517>`_
  18. Properties
  19. ----------
  20. +---------------------------+----------------------------------------------------------------+------------------------------+
  21. | :ref:`Color<class_Color>` | :ref:`color<class_ColorPickerButton_property_color>` | ``Color( 0, 0, 0, 1 )`` |
  22. +---------------------------+----------------------------------------------------------------+------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`edit_alpha<class_ColorPickerButton_property_edit_alpha>` | ``true`` |
  24. +---------------------------+----------------------------------------------------------------+------------------------------+
  25. | :ref:`bool<class_bool>` | toggle_mode | ``true`` *(parent override)* |
  26. +---------------------------+----------------------------------------------------------------+------------------------------+
  27. Methods
  28. -------
  29. +---------------------------------------+--------------------------------------------------------------------------+
  30. | :ref:`ColorPicker<class_ColorPicker>` | :ref:`get_picker<class_ColorPickerButton_method_get_picker>` **(** **)** |
  31. +---------------------------------------+--------------------------------------------------------------------------+
  32. | :ref:`PopupPanel<class_PopupPanel>` | :ref:`get_popup<class_ColorPickerButton_method_get_popup>` **(** **)** |
  33. +---------------------------------------+--------------------------------------------------------------------------+
  34. Theme Properties
  35. ----------------
  36. +---------------------------------+---------------------+-----------------------------+
  37. | :ref:`Texture<class_Texture>` | bg | |
  38. +---------------------------------+---------------------+-----------------------------+
  39. | :ref:`StyleBox<class_StyleBox>` | disabled | |
  40. +---------------------------------+---------------------+-----------------------------+
  41. | :ref:`StyleBox<class_StyleBox>` | focus | |
  42. +---------------------------------+---------------------+-----------------------------+
  43. | :ref:`Font<class_Font>` | font | |
  44. +---------------------------------+---------------------+-----------------------------+
  45. | :ref:`Color<class_Color>` | font_color | Color( 1, 1, 1, 1 ) |
  46. +---------------------------------+---------------------+-----------------------------+
  47. | :ref:`Color<class_Color>` | font_color_disabled | Color( 0.9, 0.9, 0.9, 0.3 ) |
  48. +---------------------------------+---------------------+-----------------------------+
  49. | :ref:`Color<class_Color>` | font_color_hover | Color( 1, 1, 1, 1 ) |
  50. +---------------------------------+---------------------+-----------------------------+
  51. | :ref:`Color<class_Color>` | font_color_pressed | Color( 0.8, 0.8, 0.8, 1 ) |
  52. +---------------------------------+---------------------+-----------------------------+
  53. | :ref:`StyleBox<class_StyleBox>` | hover | |
  54. +---------------------------------+---------------------+-----------------------------+
  55. | :ref:`int<class_int>` | hseparation | 2 |
  56. +---------------------------------+---------------------+-----------------------------+
  57. | :ref:`StyleBox<class_StyleBox>` | normal | |
  58. +---------------------------------+---------------------+-----------------------------+
  59. | :ref:`StyleBox<class_StyleBox>` | pressed | |
  60. +---------------------------------+---------------------+-----------------------------+
  61. Signals
  62. -------
  63. .. _class_ColorPickerButton_signal_color_changed:
  64. - **color_changed** **(** :ref:`Color<class_Color>` color **)**
  65. Emitted when the color changes.
  66. ----
  67. .. _class_ColorPickerButton_signal_picker_created:
  68. - **picker_created** **(** **)**
  69. Emitted when the :ref:`ColorPicker<class_ColorPicker>` is created (the button is pressed for the first time).
  70. ----
  71. .. _class_ColorPickerButton_signal_popup_closed:
  72. - **popup_closed** **(** **)**
  73. Emitted when the :ref:`ColorPicker<class_ColorPicker>` is closed.
  74. Property Descriptions
  75. ---------------------
  76. .. _class_ColorPickerButton_property_color:
  77. - :ref:`Color<class_Color>` **color**
  78. +-----------+-------------------------+
  79. | *Default* | ``Color( 0, 0, 0, 1 )`` |
  80. +-----------+-------------------------+
  81. | *Setter* | set_pick_color(value) |
  82. +-----------+-------------------------+
  83. | *Getter* | get_pick_color() |
  84. +-----------+-------------------------+
  85. The currently selected color.
  86. ----
  87. .. _class_ColorPickerButton_property_edit_alpha:
  88. - :ref:`bool<class_bool>` **edit_alpha**
  89. +-----------+-----------------------+
  90. | *Default* | ``true`` |
  91. +-----------+-----------------------+
  92. | *Setter* | set_edit_alpha(value) |
  93. +-----------+-----------------------+
  94. | *Getter* | is_editing_alpha() |
  95. +-----------+-----------------------+
  96. If ``true``, the alpha channel in the displayed :ref:`ColorPicker<class_ColorPicker>` will be visible.
  97. Method Descriptions
  98. -------------------
  99. .. _class_ColorPickerButton_method_get_picker:
  100. - :ref:`ColorPicker<class_ColorPicker>` **get_picker** **(** **)**
  101. Returns the :ref:`ColorPicker<class_ColorPicker>` that this node toggles.
  102. ----
  103. .. _class_ColorPickerButton_method_get_popup:
  104. - :ref:`PopupPanel<class_PopupPanel>` **get_popup** **(** **)**
  105. Returns the control's :ref:`PopupPanel<class_PopupPanel>` which allows you to connect to popup signals. This allows you to handle events when the ColorPicker is shown or hidden.
  106. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  107. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  108. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`