Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
FoldableContainer
Hérite de : Container < Control < CanvasItem < Node < Object
Un conteneur qui peut être étendu/replié.
Description
A container that can be expanded/collapsed, with a title that can be filled with controls, such as buttons. This is also called an accordion.
The title can be positioned at the top or bottom of the container. The container can be expanded or collapsed by clicking the title or by pressing ui_accept when focused. Child control nodes are hidden when the container is collapsed. Ignores non-control children.
A FoldableContainer can be grouped with other FoldableContainers so that only one of them can be opened at a time; see foldable_group and FoldableGroup.
Propriétés
focus_mode |
|
|
|
||
|
||
mouse_filter |
|
|
|
||
|
||
|
||
|
||
|
Méthodes
void |
add_title_bar_control(control: Control) |
void |
expand() |
void |
fold() |
void |
remove_title_bar_control(control: Control) |
Propriétés du thème
|
||
|
||
|
||
|
||
|
||
|
||
Signaux
folding_changed(is_folded: bool) 🔗
Émis lorsque le conteneur est replié/étendu.
Énumérations
enum TitlePosition: 🔗
TitlePosition POSITION_TOP = 0
Fait que le titre apparaît en haut du conteneur.
TitlePosition POSITION_BOTTOM = 1
Fait que le titre apparaît en bas du conteneur. Inverse aussi verticalement toutes les StyleBoxes.
Descriptions des propriétés
FoldableGroup foldable_group 🔗
void set_foldable_group(value: FoldableGroup)
FoldableGroup get_foldable_group()
The FoldableGroup associated with the container. When multiple FoldableContainer nodes share the same group, only one of them is allowed to be unfolded.
If true, the container will become folded and will hide all its children.
Language code used for text shaping algorithms. If left empty, the current locale is used instead.
Le texte du titre du conteneur.
HorizontalAlignment title_alignment = 0 🔗
void set_title_alignment(value: HorizontalAlignment)
HorizontalAlignment get_title_alignment()
L'alignement horizontal du texte du titre.
TitlePosition title_position = 0 🔗
void set_title_position(value: TitlePosition)
TitlePosition get_title_position()
Position du titre.
TextDirection title_text_direction = 0 🔗
void set_title_text_direction(value: TextDirection)
TextDirection get_title_text_direction()
Direction d'écriture du texte du titre.
OverrunBehavior title_text_overrun_behavior = 0 🔗
void set_title_text_overrun_behavior(value: OverrunBehavior)
OverrunBehavior get_title_text_overrun_behavior()
Définit le comportement du titre lorsque le texte est plus long que l'espace disponible.
Descriptions des méthodes
void add_title_bar_control(control: Control) 🔗
Adds a Control that will be placed next to the container's title, obscuring the clickable area. Prime usage is adding Button nodes, but it can be any Control.
The control will be added as a child of this container and removed from previous parent if necessary. The controls will be placed aligned to the right, with the first added control being the leftmost one.
void expand() 🔗
Expands the container and emits folding_changed.
void fold() 🔗
Folds the container and emits folding_changed.
void remove_title_bar_control(control: Control) 🔗
Removes a Control added with add_title_bar_control(). The node is not freed automatically, you need to use Node.queue_free().
Descriptions des propriétés du thème
Color collapsed_font_color = Color(1, 1, 1, 1) 🔗
La couleur de police du titre lorsqu'il est replié.
Color font_color = Color(0.875, 0.875, 0.875, 1) 🔗
La couleur de police du titre lorsqu'il est étendu.
Color font_outline_color = Color(1, 1, 1, 1) 🔗
La couleur du contour de la police du titre.
Color hover_font_color = Color(0.95, 0.95, 0.95, 1) 🔗
La couleur de survolement de la police du titre.
La séparation horizontale entre l'icône et le texte du titre, et entre les contrôles de la barre du titre.
La taille du contour de la police du titre.
La police du titre.
La taille de police du titre.
L'icône du titre utilisée lorsqu'il est étendu.
Texture2D expanded_arrow_mirrored 🔗
L'icône du titre utilisée lorsqu'il est étendu (pour un titre en bas).
L'icône du titre utilisée lorsqu'il est replié (pour une mise en page de gauche-à-droite).
Texture2D folded_arrow_mirrored 🔗
L'icône du titre utilisée lorsqu'il est replié (pour une mise en page de droite-à-gauche).
Background used when FoldableContainer has GUI focus. The focus StyleBox is displayed over the base StyleBox, so a partially transparent StyleBox should be used to ensure the base StyleBox remains visible. A StyleBox that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a StyleBoxEmpty resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
Arrière-plan par défaut pour le FoldableContainer.
StyleBox title_collapsed_hover_panel 🔗
Background used when the mouse cursor enters the title's area when collapsed.
StyleBox title_collapsed_panel 🔗
Default background for the FoldableContainer's title when collapsed.
Background used when the mouse cursor enters the title's area when expanded.
Default background for the FoldableContainer's title when expanded.