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...
SplitContainer
Hérite de : Container < Control < CanvasItem < Node < Object
Hérité par : HSplitContainer, VSplitContainer
A container that arranges child controls horizontally or vertically and provides grabbers for adjusting the split ratios between them.
Description
A container that arranges child controls horizontally or vertically and creates grabbers between them. The grabbers can be dragged around to change the size relations between the child controls.
Tutoriels
Propriétés
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Méthodes
void |
clamp_split_offset(priority_index: int = 0) |
Propriétés du thème
|
||
|
||
|
||
|
||
|
||
|
||
Signaux
drag_ended() 🔗
Émis lorsque l'utilisateur arrête le glissement.
drag_started() 🔗
Émis lorsque l'utilisateur commence un glissement.
Emitted when any dragger is dragged by user.
Énumérations
enum DraggerVisibility: 🔗
DraggerVisibility DRAGGER_VISIBLE = 0
L'icône de l’ascenseur de séparation est toujours visible lorsque autohide vaut false, sinon visible seulement lorsque le curseur le survole.
La taille de l'icône de l'ascenseur détermine la séparation minimale separation.
L'icône de l'ascenseur est automatiquement cachée si la longueur de l'icône de l'ascenseur est plus longue que la barre de séparation.
L'icône de l’ascenseur de séparation n'est jamais visible peu importe la valeur de autohide.
La taille de l'icône de l'ascenseur détermine la séparation minimale separation.
L'icône de l’ascenseur de séparation n'est pas visible, et la barre de séparation est réduite à une épaisseur nulle.
Descriptions des propriétés
If true, the draggers will be disabled and the children will be sized as if all split_offsets were 0.
bool drag_area_highlight_in_editor = false 🔗
Fait ressortir le Rect2 de la zone de glissement pour que vous puissiez voir où elle est pendant le développement. La zone de glissement est en or si dragging_enabled vaut true, et rouge si false.
int drag_area_margin_begin = 0 🔗
Réduit la taille de la zone de glissement et de la barre de séparation split_bar_background au début du conteneur.
int drag_area_margin_end = 0 🔗
Réduit la taille de la zone de glissement et de la barre de séparation split_bar_background à la fin du conteneur.
Décale la zone de glissement dans l'axe du conteneur pour empêcher la zone de glissement de recouvrir la ScrollBar ou tout autre Control sélectionnable d'un nœud enfant.
bool drag_nested_intersections = false 🔗
Adds extra draggers at the intersection of the draggers of two SplitContainers to allow dragging both at once. This must be set to true for both SplitContainers, and one needs to be a descendant of the other. They also must be orthogonal (their vertical are different) and the descendant must be next to at least one of the ancestor's draggers (within minimum_grab_thickness).
DraggerVisibility dragger_visibility = 0 🔗
void set_dragger_visibility(value: DraggerVisibility)
DraggerVisibility get_dragger_visibility()
Détermine la visibilité de l’ascenseur. Cette propriété ne détermine pas si le glissement est activé ou non. Utilisez dragging_enabled pour cela.
bool dragging_enabled = true 🔗
Active ou désactive le glissement de la séparation.
Obsolète : Use split_offsets instead. The first element of the array is the split offset between the first two children.
The first element of split_offsets.
PackedInt32Array split_offsets = PackedInt32Array(0) 🔗
void set_split_offsets(value: PackedInt32Array)
PackedInt32Array get_split_offsets()
Offsets for each dragger in pixels. Each one is the offset of the split between the Control nodes before and after the dragger, with 0 being the default position. The default position is based on the Control nodes expand flags and minimum sizes. See Control.size_flags_horizontal, Control.size_flags_vertical, and Control.size_flags_stretch_ratio.
If none of the Control nodes before the dragger are expanded, the default position will be at the start of the SplitContainer. If none of the Control nodes after the dragger are expanded, the default position will be at the end of the SplitContainer. If the dragger is in between expanded Control nodes, the default position will be in the middle, based on the Control.size_flags_stretch_ratios and minimum sizes.
Note: If the split offsets cause Control nodes to overlap, the first split will take priority when resolving the positions.
Note: The returned array is copied and any changes to it will not update the original property value. See PackedInt32Array for more details.
bool touch_dragger_enabled = false 🔗
Si true, une poignée de glissement adaptée au tactile sera activée pour une meilleure utilisabilité sur les écrans plus petits. Contrairement à l'ascenseur standard, cette poignée de glissement recouvre les enfants du SplitContainer et n'affecte pas leur séparation minimale. L'ascenseur standard ne sera plus dessiné lorsque cette option sera activée.
Si true, le SplitContainer arrangera ses enfants verticalement, plutôt que horizontalement.
Ne peut être changé lors de l'utilisation de HSplitContainer et de VSplitContainer.
Descriptions des méthodes
void clamp_split_offset(priority_index: int = 0) 🔗
Clamps the split_offsets values to ensure they are within valid ranges and do not overlap with each other. When overlaps occur, this method prioritizes one split offset (at index priority_index) by clamping any overlapping split offsets to it.
Control get_drag_area_control() 🔗
Obsolète : Use the first element of get_drag_area_controls() instead.
Returns the drag area Control. For example, you can move a pre-configured button into the drag area Control so that it rides along with the split bar. Try setting the Button anchors to center prior to the reparent() call.
$BarnacleButton.reparent($SplitContainer.get_drag_area_control())
Note: The drag area Control is drawn over the SplitContainer's children, so CanvasItem draw objects called from the Control and children added to the Control will also appear over the SplitContainer's children. Try setting Control.mouse_filter of custom children to Control.MOUSE_FILTER_IGNORE to prevent blocking the mouse from dragging if desired.
Warning: This is a required internal node, removing and freeing it may cause a crash.
Array[Control] get_drag_area_controls() 🔗
Returns an Array of the drag area Controls. These are the interactable Control nodes between each child. For example, this can be used to add a pre-configured button to a drag area Control so that it rides along with the split bar. Try setting the Button anchors to center prior to the Node.reparent() call.
$BarnacleButton.reparent($SplitContainer.get_drag_area_controls()[0])
Note: The drag area Controls are drawn over the SplitContainer's children, so CanvasItem draw objects called from a drag area and children added to it will also appear over the SplitContainer's children. Try setting Control.mouse_filter of custom children to Control.MOUSE_FILTER_IGNORE to prevent blocking the mouse from dragging if desired.
Warning: These are required internal nodes, removing or freeing them may cause a crash.
Descriptions des propriétés du thème
Color touch_dragger_color = Color(1, 1, 1, 0.3) 🔗
La couleur de l’ascenseur tactile.
Color touch_dragger_hover_color = Color(1, 1, 1, 0.6) 🔗
La couleur de l’ascenseur tactile lorsque survolé.
Color touch_dragger_pressed_color = Color(1, 1, 1, 1) 🔗
La couleur de l’ascenseur tactile lorsqu'appuyé.
Boolean value. If 1 (true), the grabbers will hide automatically when they aren't under the cursor. If 0 (false), the grabbers are always visible. The dragger_visibility must be DRAGGER_VISIBLE.
int minimum_grab_thickness = 6 🔗
The minimum thickness of the area users can click on to grab a split bar. This ensures that the split bar can still be dragged if separation or h_grabber / v_grabber's size is too narrow to easily select.
The split bar thickness, i.e., the gap between each child of the container. This is overridden by the size of the grabber icon if dragger_visibility is set to DRAGGER_VISIBLE, or DRAGGER_HIDDEN, and separation is smaller than the size of the grabber icon in the same axis.
Note: To obtain separation values less than the size of the grabber icon, for example a 1 px hairline, set h_grabber or v_grabber to a new ImageTexture, which effectively sets the grabber icon size to 0 px.
The icon used for the grabbers drawn in the separations. This is only used in HSplitContainer and VSplitContainer. For SplitContainer, see h_grabber and v_grabber instead.
The icon used for the grabbers drawn in the separations when vertical is false.
L'icône utilisée pour la poignée à glisser lorsque touch_dragger_enabled vaut true et que vertical vaut false.
L'icône utilisée pour la poignée de glissement lorsque touch_dragger_enabled vaut true. Ceci est utilisé uniquement dans HSplitContainer et VSplitContainer. Pour SplitContainer, voir h_touch_dragger et v_touch_dragger à la place.
The icon used for the grabbers drawn in the separations when vertical is true.
L'icône utilisée pour la poignée à glisser lorsque touch_dragger_enabled vaut true et que vertical vaut true.
StyleBox split_bar_background 🔗
Détermine le fond de la barre de séparation si son épaisseur est supérieure à zéro.