ChangeEvent is fired when the progress bar knob is moved. Cancelling the event will move the knob to where it was
previously.
For a horizontal progress bar, its preferred height is determined by the larger of the knob and background, and the preferred width is 140, a relatively arbitrary size. These parameters are reversed for a vertical progress bar.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ProgressBar.
The style for a progress bar, see |
| Modifier and Type | Field and Description |
|---|---|
| private float | |
| private float | |
| private Interpolation | |
| private float | |
| pack-priv boolean | |
| pack-priv float | |
| pack-priv float | |
| pack-priv float | |
| private boolean | |
| private boolean | |
| pack-priv float | |
| private ProgressBar. | |
| private float | |
| pack-priv final boolean | |
| private Interpolation |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | ProgressBar(float
the minimum value min, float the maximum value max, float the step size between values stepSize, boolean vertical, ProgressBar.the styleProgressBarStyleCreates a new progress bar. |
| Modifier and Type | Method and Description |
|---|---|
| public void | act(float delta)
Overrides com. Updates the actor based on time. |
| protected float | |
| public void | draw(Batch batch, float parentAlpha)
Overrides com. If this method is overridden, the super method or |
| private void | |
| protected Drawable | |
| protected Drawable | |
| protected Drawable | |
| protected Drawable | |
| protected float | getKnobPosition()
Returns progress bar visual position within the range (as it was last calculated in |
| public float | |
| public float | |
| public float | |
| public float | |
| public float | |
| public boolean | |
| public float | |
| public ProgressBar. | getStyle()
Implements com. Returns the progress bar's style. |
| public float | |
| public float | |
| public float | |
| public boolean | |
| public boolean | |
| public boolean | |
| protected float | |
| public void | setAnimateDuration(float duration)
If > 0, changes to the progress bar value via |
| public void | setAnimateInterpolation(Interpolation animateInterpolation)
Sets the interpolation to use for |
| public void | setDisabled(boolean disabled)
Implements com.
|
| public void | setProgrammaticChangeEvents(boolean programmaticChangeEvents)
If false, |
| public void | |
| public void | setRound(boolean round)
If true (the default), inner Drawable positions and sizes are rounded to integers. |
| public void | |
| public void | setStyle(ProgressBar.
Implements com. Set the current style of the actor |
| public boolean | Returns: false if the value was not changed because the progress bar already had the value or it was canceled by a listener.Sets the progress bar position, rounded to the nearest step size and clamped to the minimum and maximum values. |
| public void | |
| public void |
| animateDuration | back to summary |
|---|---|
| private float animateDuration | |
| animateFromValue | back to summary |
|---|---|
| private float animateFromValue | |
| animateInterpolation | back to summary |
|---|---|
| private Interpolation animateInterpolation | |
| animateTime | back to summary |
|---|---|
| private float animateTime | |
| disabled | back to summary |
|---|---|
| pack-priv boolean disabled | |
| max | back to summary |
|---|---|
| pack-priv float max | |
| min | back to summary |
|---|---|
| pack-priv float min | |
| position | back to summary |
|---|---|
| pack-priv float position | |
| programmaticChangeEvents | back to summary |
|---|---|
| private boolean programmaticChangeEvents | |
| round | back to summary |
|---|---|
| private boolean round | |
| stepSize | back to summary |
|---|---|
| pack-priv float stepSize | |
| style | back to summary |
|---|---|
| private ProgressBar. | |
| value | back to summary |
|---|---|
| private float value | |
| vertical | back to summary |
|---|---|
| pack-priv final boolean vertical | |
| visualInterpolation | back to summary |
|---|---|
| private Interpolation visualInterpolation | |
| ProgressBar | back to summary |
|---|---|
| public ProgressBar(float min, float max, float stepSize, boolean vertical, Skin skin) | |
| ProgressBar | back to summary |
|---|---|
| public ProgressBar(float min, float max, float stepSize, boolean vertical, Skin skin, String styleName) | |
| ProgressBar | back to summary |
|---|---|
| public ProgressBar(float min, float max, float stepSize, boolean vertical, ProgressBar. Creates a new progress bar. If horizontal, its width is determined by the prefWidth parameter, and its height is determined
by the maximum of the height of either the progress bar E.g. min could be 4, max could be 10 and stepSize could be 0.2, giving you a total of 30 values, 4.0 4.2, 4.4 and so on.
| |
| act | back to summary |
|---|---|
| public void act(float delta) Overrides com. Doc from com. Updates the actor based on time. Typically this is called each frame by
The default implementation calls | |
| clamp | back to summary |
|---|---|
| protected float clamp(float value) Clamps the value to the progress bar's min/max range. This can be overridden to allow a range different from the progress bar knob's range. | |
| draw | back to summary |
|---|---|
| public void draw(Batch batch, float parentAlpha) Overrides com. Doc from com. If this method is overridden, the super method or | |
| drawRound | back to summary |
|---|---|
| private void drawRound(Batch batch, Drawable drawable, float x, float y, float w, float h) | |
| getBackgroundDrawable | back to summary |
|---|---|
protected Drawable getBackgroundDrawable()
| |
| getKnobAfterDrawable | back to summary |
|---|---|
| protected Drawable getKnobAfterDrawable() | |
| getKnobBeforeDrawable | back to summary |
|---|---|
| protected Drawable getKnobBeforeDrawable() | |
| getKnobDrawable | back to summary |
|---|---|
protected Drawable getKnobDrawable()
| |
| getKnobPosition | back to summary |
|---|---|
| protected float getKnobPosition() Returns progress bar visual position within the range (as it was last calculated in | |
| getMaxValue | back to summary |
|---|---|
| public float getMaxValue() | |
| getMinValue | back to summary |
|---|---|
| public float getMinValue() | |
| getPercent | back to summary |
|---|---|
| public float getPercent() | |
| getPrefHeight | back to summary |
|---|---|
| public float getPrefHeight() Overrides com. Implements com. | |
| getPrefWidth | back to summary |
|---|---|
| public float getPrefWidth() Overrides com. Implements com. | |
| getProgrammaticChangeEvents | back to summary |
|---|---|
| public boolean getProgrammaticChangeEvents() | |
| getStepSize | back to summary |
|---|---|
| public float getStepSize() | |
| getStyle | back to summary |
|---|---|
| public ProgressBar. Implements com. Returns the progress bar's style. Modifying the returned style may not have an effect until
| |
| getValue | back to summary |
|---|---|
| public float getValue() | |
| getVisualPercent | back to summary |
|---|---|
| public float getVisualPercent() | |
| getVisualValue | back to summary |
|---|---|
| public float getVisualValue() If | |
| isAnimating | back to summary |
|---|---|
| public boolean isAnimating() | |
| isDisabled | back to summary |
|---|---|
| public boolean isDisabled() Implements com. | |
| isVertical | back to summary |
|---|---|
| public boolean isVertical() True if the progress bar is vertical, false if it is horizontal. | |
| round | back to summary |
|---|---|
| protected float round(float value) Rouinds the value using the progress bar's step size. This can be overridden to customize or disable rounding. | |
| setAnimateDuration | back to summary |
|---|---|
| public void setAnimateDuration(float duration) If > 0, changes to the progress bar value via | |
| setAnimateInterpolation | back to summary |
|---|---|
| public void setAnimateInterpolation(Interpolation animateInterpolation) Sets the interpolation to use for | |
| setDisabled | back to summary |
|---|---|
| public void setDisabled(boolean disabled) Implements com. | |
| setProgrammaticChangeEvents | back to summary |
|---|---|
| public void setProgrammaticChangeEvents(boolean programmaticChangeEvents) If false, | |
| setRange | back to summary |
|---|---|
| public void setRange(float min, float max) Sets the range of this progress bar. The progress bar's current value is clamped to the range. | |
| setRound | back to summary |
|---|---|
| public void setRound(boolean round) If true (the default), inner Drawable positions and sizes are rounded to integers. | |
| setStepSize | back to summary |
|---|---|
| public void setStepSize(float stepSize) | |
| setStyle | back to summary |
|---|---|
| public void setStyle(ProgressBar. Implements com. Doc from com. Set the current style of the actor | |
| setValue | back to summary |
|---|---|
| public boolean setValue(float value) Sets the progress bar position, rounded to the nearest step size and clamped to the minimum and maximum values.
| |
| setVisualInterpolation | back to summary |
|---|---|
| public void setVisualInterpolation(Interpolation interpolation) Sets the interpolation to use for display. | |
| updateVisualValue | back to summary |
|---|---|
| public void updateVisualValue() Sets the visual value equal to the actual value. This can be used to set the value without animating. | |
ProgressBar.
| Modifier and Type | Field and Description |
|---|---|
| public Drawable | background
The progress bar background, stretched only in one direction. |
| public Drawable | disabledBackground
The progress bar background, stretched only in one direction. |
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public Drawable |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| background | back to summary |
|---|---|
| public Drawable background The progress bar background, stretched only in one direction. | |
| disabledBackground | back to summary |
|---|---|
| public Drawable disabledBackground The progress bar background, stretched only in one direction. | |
| disabledKnob | back to summary |
|---|---|
| public Drawable disabledKnob
| |
| disabledKnobAfter | back to summary |
|---|---|
| public Drawable disabledKnobAfter
| |
| disabledKnobBefore | back to summary |
|---|---|
| public Drawable disabledKnobBefore
| |
| knob | back to summary |
|---|---|
| public Drawable knob
| |
| knobAfter | back to summary |
|---|---|
| public Drawable knobAfter
| |
| knobBefore | back to summary |
|---|---|
| public Drawable knobBefore
| |
| ProgressBarStyle | back to summary |
|---|---|
| public ProgressBarStyle() | |
| ProgressBarStyle | back to summary |
|---|---|
| public ProgressBarStyle(Drawable background, Drawable knob) | |
| ProgressBarStyle | back to summary |
|---|---|
| public ProgressBarStyle(ProgressBar. | |