Group that participates in layout and provides a minimum, preferred, and maximum size.
The default preferred size of a widget group is 0 and this is almost always overridden by a subclass. The default minimum size returns the preferred size, so a subclass may choose to return 0 for minimum size if it wants to allow itself to be sized smaller than the preferred size. The default maximum size is 0, which means no maximum size.
See Layout for details on how a widget group should participate in layout. A widget group's mutator methods should call
invalidate() or invalidateHierarchy() as needed. By default, invalidateHierarchy is called when child widgets
are added and removed.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | childrenChanged()
Overrides com. Called when actors are added to or removed from the group. |
| public void | draw(Batch batch, float parentAlpha)
Overrides com. If this method is overridden, the super method or |
| public float | getMaxHeight()
Implements com. Zero indicates no max height. |
| public float | getMaxWidth()
Implements com. Zero indicates no max width. |
| public float | |
| public float | |
| public float | |
| public float | |
| public Actor | hit(float x, float y, boolean touchable)
Overrides com. If this method is overridden, the super method or |
| public void | invalidate()
Implements com. Invalidates this actor's layout, causing |
| public void | invalidateHierarchy()
Implements com. Invalidates this actor and its ascendants, calling |
| public void | layout()
Implements com. Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child,
calls |
| public boolean | |
| public void | pack()
Implements com. Sizes this actor to its preferred width and height, then calls |
| public void | setFillParent(boolean fillParent)
Implements com. If true, this actor will be sized to the parent in |
| public void | setLayoutEnabled(boolean enabled)
Implements com. Enables or disables the layout for this actor and all child actors, recursively. |
| private void | |
| protected void | sizeChanged()
Overrides com. Called when the actor's size has been changed. |
| public void | validate()
Implements com. Ensures the actor has been laid out. |
| fillParent | back to summary |
|---|---|
| private boolean fillParent | |
| layoutEnabled | back to summary |
|---|---|
| private boolean layoutEnabled | |
| needsLayout | back to summary |
|---|---|
| private boolean needsLayout | |
| WidgetGroup | back to summary |
|---|---|
| public WidgetGroup() | |
| WidgetGroup | back to summary |
|---|---|
| public WidgetGroup(Actor... actors) Creates a new widget group containing the specified actors. | |
| childrenChanged | back to summary |
|---|---|
| protected void childrenChanged() Overrides com. Doc from com. Called when actors are added to or removed from the group. | |
| draw | back to summary |
|---|---|
| public void draw(Batch batch, float parentAlpha) Overrides com. If this method is overridden, the super method or | |
| getMaxHeight | back to summary |
|---|---|
| public float getMaxHeight() Implements com. Doc from com. Zero indicates no max height. | |
| getMaxWidth | back to summary |
|---|---|
| public float getMaxWidth() Implements com. Doc from com. Zero indicates no max width. | |
| getMinHeight | back to summary |
|---|---|
| public float getMinHeight() Implements com. | |
| getMinWidth | back to summary |
|---|---|
| public float getMinWidth() Implements com. | |
| getPrefHeight | back to summary |
|---|---|
| public float getPrefHeight() Implements com. | |
| getPrefWidth | back to summary |
|---|---|
| public float getPrefWidth() Implements com. | |
| hit | back to summary |
|---|---|
| public Actor hit(float x, float y, boolean touchable) Overrides com. If this method is overridden, the super method or | |
| invalidate | back to summary |
|---|---|
| public void invalidate() Implements com. Doc from com. Invalidates this actor's layout, causing | |
| invalidateHierarchy | back to summary |
|---|---|
| public void invalidateHierarchy() Implements com. Doc from com. Invalidates this actor and its ascendants, calling | |
| layout | back to summary |
|---|---|
| public void layout() Implements com. Doc from com. Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child,
calls | |
| needsLayout | back to summary |
|---|---|
| public boolean needsLayout() Returns true if the widget's layout has been | |
| pack | back to summary |
|---|---|
| public void pack() Implements com. Doc from com. Sizes this actor to its preferred width and height, then calls
Generally this method should not be called in an actor's constructor because it calls | |
| setFillParent | back to summary |
|---|---|
| public void setFillParent(boolean fillParent) Implements com. Doc from com. If true, this actor will be sized to the parent in | |
| setLayoutEnabled | back to summary |
|---|---|
| public void setLayoutEnabled(boolean enabled) Implements com. Doc from com. Enables or disables the layout for this actor and all child actors, recursively. When false, | |
| setLayoutEnabled | back to summary |
|---|---|
| private void setLayoutEnabled(Group parent, boolean enabled) | |
| sizeChanged | back to summary |
|---|---|
| protected void sizeChanged() Overrides com. Doc from com. Called when the actor's size has been changed. | |
| validate | back to summary |
|---|---|
| public void validate() Implements com. Doc from com. Ensures the actor has been laid out. Calls | |