Actor that participates in layout and provides a minimum, preferred, and maximum size.
The default preferred size of a widget 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 if it wants to allow itself to be sized smaller. The default maximum size is 0, which means no maximum size.
See Layout for details on how a widget should participate in layout. A widget's mutator methods should call
invalidate() or invalidateHierarchy() as needed.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| 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 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. |
| 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 | |
| Widget | back to summary |
|---|---|
| public Widget() | |
| 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. | |
| 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, | |
| 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 | |