class_colorrect.rst 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ColorRect.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ColorRect:
  6. ColorRect
  7. =========
  8. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Colored rectangle.
  10. Description
  11. -----------
  12. Displays a rectangle filled with a solid :ref:`color<class_ColorRect_property_color>`. If you need to display the border alone, consider using :ref:`ReferenceRect<class_ReferenceRect>` instead.
  13. Tutorials
  14. ---------
  15. - `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`__
  16. Properties
  17. ----------
  18. +---------------------------+----------------------------------------------+-------------------------+
  19. | :ref:`Color<class_Color>` | :ref:`color<class_ColorRect_property_color>` | ``Color( 1, 1, 1, 1 )`` |
  20. +---------------------------+----------------------------------------------+-------------------------+
  21. Property Descriptions
  22. ---------------------
  23. .. _class_ColorRect_property_color:
  24. - :ref:`Color<class_Color>` **color**
  25. +-----------+-------------------------+
  26. | *Default* | ``Color( 1, 1, 1, 1 )`` |
  27. +-----------+-------------------------+
  28. | *Setter* | set_frame_color(value) |
  29. +-----------+-------------------------+
  30. | *Getter* | get_frame_color() |
  31. +-----------+-------------------------+
  32. The fill color.
  33. ::
  34. $ColorRect.color = Color(1, 0, 0, 1) # Set ColorRect's color to red.
  35. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  36. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  37. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`