class_colorpickerbutton.rst 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. Properties
  14. ----------
  15. +---------------------------+----------------------------------------------------------------+------------------------------+
  16. | :ref:`Color<class_Color>` | :ref:`color<class_ColorPickerButton_property_color>` | ``Color( 0, 0, 0, 1 )`` |
  17. +---------------------------+----------------------------------------------------------------+------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`edit_alpha<class_ColorPickerButton_property_edit_alpha>` | ``true`` |
  19. +---------------------------+----------------------------------------------------------------+------------------------------+
  20. | :ref:`bool<class_bool>` | toggle_mode | ``true`` *(parent override)* |
  21. +---------------------------+----------------------------------------------------------------+------------------------------+
  22. Methods
  23. -------
  24. +---------------------------------------+--------------------------------------------------------------------------+
  25. | :ref:`ColorPicker<class_ColorPicker>` | :ref:`get_picker<class_ColorPickerButton_method_get_picker>` **(** **)** |
  26. +---------------------------------------+--------------------------------------------------------------------------+
  27. | :ref:`PopupPanel<class_PopupPanel>` | :ref:`get_popup<class_ColorPickerButton_method_get_popup>` **(** **)** |
  28. +---------------------------------------+--------------------------------------------------------------------------+
  29. Theme Properties
  30. ----------------
  31. +---------------------------------+---------------------+-----------------------------+
  32. | :ref:`Texture<class_Texture>` | bg | |
  33. +---------------------------------+---------------------+-----------------------------+
  34. | :ref:`StyleBox<class_StyleBox>` | disabled | |
  35. +---------------------------------+---------------------+-----------------------------+
  36. | :ref:`StyleBox<class_StyleBox>` | focus | |
  37. +---------------------------------+---------------------+-----------------------------+
  38. | :ref:`Font<class_Font>` | font | |
  39. +---------------------------------+---------------------+-----------------------------+
  40. | :ref:`Color<class_Color>` | font_color | Color( 1, 1, 1, 1 ) |
  41. +---------------------------------+---------------------+-----------------------------+
  42. | :ref:`Color<class_Color>` | font_color_disabled | Color( 0.9, 0.9, 0.9, 0.3 ) |
  43. +---------------------------------+---------------------+-----------------------------+
  44. | :ref:`Color<class_Color>` | font_color_hover | Color( 1, 1, 1, 1 ) |
  45. +---------------------------------+---------------------+-----------------------------+
  46. | :ref:`Color<class_Color>` | font_color_pressed | Color( 0.8, 0.8, 0.8, 1 ) |
  47. +---------------------------------+---------------------+-----------------------------+
  48. | :ref:`StyleBox<class_StyleBox>` | hover | |
  49. +---------------------------------+---------------------+-----------------------------+
  50. | :ref:`int<class_int>` | hseparation | 2 |
  51. +---------------------------------+---------------------+-----------------------------+
  52. | :ref:`StyleBox<class_StyleBox>` | normal | |
  53. +---------------------------------+---------------------+-----------------------------+
  54. | :ref:`StyleBox<class_StyleBox>` | pressed | |
  55. +---------------------------------+---------------------+-----------------------------+
  56. Signals
  57. -------
  58. .. _class_ColorPickerButton_signal_color_changed:
  59. - **color_changed** **(** :ref:`Color<class_Color>` color **)**
  60. Emitted when the color changes.
  61. ----
  62. .. _class_ColorPickerButton_signal_picker_created:
  63. - **picker_created** **(** **)**
  64. Emitted when the :ref:`ColorPicker<class_ColorPicker>` is created (the button is pressed for the first time).
  65. ----
  66. .. _class_ColorPickerButton_signal_popup_closed:
  67. - **popup_closed** **(** **)**
  68. Emitted when the :ref:`ColorPicker<class_ColorPicker>` is closed.
  69. Property Descriptions
  70. ---------------------
  71. .. _class_ColorPickerButton_property_color:
  72. - :ref:`Color<class_Color>` **color**
  73. +-----------+-------------------------+
  74. | *Default* | ``Color( 0, 0, 0, 1 )`` |
  75. +-----------+-------------------------+
  76. | *Setter* | set_pick_color(value) |
  77. +-----------+-------------------------+
  78. | *Getter* | get_pick_color() |
  79. +-----------+-------------------------+
  80. The currently selected color.
  81. ----
  82. .. _class_ColorPickerButton_property_edit_alpha:
  83. - :ref:`bool<class_bool>` **edit_alpha**
  84. +-----------+-----------------------+
  85. | *Default* | ``true`` |
  86. +-----------+-----------------------+
  87. | *Setter* | set_edit_alpha(value) |
  88. +-----------+-----------------------+
  89. | *Getter* | is_editing_alpha() |
  90. +-----------+-----------------------+
  91. If ``true``, the alpha channel in the displayed :ref:`ColorPicker<class_ColorPicker>` will be visible.
  92. Method Descriptions
  93. -------------------
  94. .. _class_ColorPickerButton_method_get_picker:
  95. - :ref:`ColorPicker<class_ColorPicker>` **get_picker** **(** **)**
  96. Returns the :ref:`ColorPicker<class_ColorPicker>` that this node toggles.
  97. ----
  98. .. _class_ColorPickerButton_method_get_popup:
  99. - :ref:`PopupPanel<class_PopupPanel>` **get_popup** **(** **)**
  100. 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.
  101. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  102. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  103. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`