The preferred size of the touchpad is determined by the background.
ChangeEvent is fired when the touchpad knob is moved. Cancelling the event will move the knob to where it was
previously.
| Modifier and Type | Class and Description |
|---|---|
| public static class | Touchpad.
The style for a |
| Modifier and Type | Field and Description |
|---|---|
| private final Circle | |
| private float | |
| private final Circle | |
| private final Vector2 | |
| private final Vector2 | |
| pack-priv boolean | |
| private Touchpad. | |
| private final Circle | |
| pack-priv boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | Touchpad(float
The distance in pixels from the center of the touchpad required for the knob to be moved. deadzoneRadius, Touchpad.
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| public void | draw(Batch batch, float parentAlpha)
Overrides com. If this method is overridden, the super method or |
| public float | getKnobPercentX()
Returns the x-position of the knob as a percentage from the center of the touchpad to the edge of the circular movement area. |
| public float | getKnobPercentY()
Returns the y-position of the knob as a percentage from the center of the touchpad to the edge of the circular movement area. |
| public float | |
| public float | |
| public float | |
| public float | |
| public boolean | |
| public Touchpad. | getStyle()
Implements com. Returns the touchpad's style. |
| public Actor | hit(float x, float y, boolean touchable)
Overrides com. Returns the deepest |
| public boolean | |
| public void | layout()
Overrides com. Implements com. Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child,
calls |
| public void | setDeadzone(float
The distance in pixels from the center of the touchpad required for the knob to be moved. deadzoneRadius)
|
| public void | |
| public void | setStyle(Touchpad.
Implements com. Set the current style of the actor |
| deadzoneBounds | back to summary |
|---|---|
| private final Circle deadzoneBounds | |
| deadzoneRadius | back to summary |
|---|---|
| private float deadzoneRadius | |
| knobBounds | back to summary |
|---|---|
| private final Circle knobBounds | |
| knobPercent | back to summary |
|---|---|
| private final Vector2 knobPercent | |
| knobPosition | back to summary |
|---|---|
| private final Vector2 knobPosition | |
| resetOnTouchUp | back to summary |
|---|---|
| pack-priv boolean resetOnTouchUp | |
| style | back to summary |
|---|---|
| private Touchpad. | |
| touchBounds | back to summary |
|---|---|
| private final Circle touchBounds | |
| touched | back to summary |
|---|---|
| pack-priv boolean touched | |
| Touchpad | back to summary |
|---|---|
public Touchpad(float deadzoneRadius, Skin skin)
| |
| Touchpad | back to summary |
|---|---|
public Touchpad(float deadzoneRadius, Skin skin, String styleName)
| |
| Touchpad | back to summary |
|---|---|
public Touchpad(float deadzoneRadius, Touchpad.
| |
| calculatePositionAndValue | back to summary |
|---|---|
| pack-priv void calculatePositionAndValue(float x, float y, boolean isTouchUp) | |
| 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 | |
| getKnobPercentX | back to summary |
|---|---|
| public float getKnobPercentX() Returns the x-position of the knob as a percentage from the center of the touchpad to the edge of the circular movement area. The positive direction is right. | |
| getKnobPercentY | back to summary |
|---|---|
| public float getKnobPercentY() Returns the y-position of the knob as a percentage from the center of the touchpad to the edge of the circular movement area. The positive direction is up. | |
| getKnobX | back to summary |
|---|---|
| public float getKnobX() Returns the x-position of the knob relative to the center of the widget. The positive direction is right. | |
| getKnobY | back to summary |
|---|---|
| public float getKnobY() Returns the y-position of the knob relative to the center of the widget. The positive direction is up. | |
| getPrefHeight | back to summary |
|---|---|
| public float getPrefHeight() Overrides com. Implements com. | |
| getPrefWidth | back to summary |
|---|---|
| public float getPrefWidth() Overrides com. Implements com. | |
| getResetOnTouchUp | back to summary |
|---|---|
| public boolean getResetOnTouchUp() | |
| getStyle | back to summary |
|---|---|
| public Touchpad. Implements com. Returns the touchpad's style. Modifying the returned style may not have an effect until | |
| hit | back to summary |
|---|---|
| public Actor hit(float x, float y, boolean touchable) Overrides com. Doc from com. Returns the deepest This method is used to delegate touchDown, mouse, and enter/exit events. If this method returns null, those events will not occur on this Actor. The default implementation returns this actor if the point is within this actor's bounds and this actor is visible. | |
| isTouched | back to summary |
|---|---|
| public boolean isTouched() | |
| layout | back to summary |
|---|---|
| public void layout() Overrides com. 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 | |
| setDeadzone | back to summary |
|---|---|
public void setDeadzone(float deadzoneRadius)
| |
| setResetOnTouchUp | back to summary |
|---|---|
public void setResetOnTouchUp(boolean reset)
| |
| setStyle | back to summary |
|---|---|
| public void setStyle(Touchpad. Implements com. Doc from com. Set the current style of the actor | |
Touchpad.
| Modifier and Type | Field and Description |
|---|---|
| public Drawable | background
Stretched in both directions. |
| public Drawable |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| background | back to summary |
|---|---|
| public Drawable background Stretched in both directions. | |
| knob | back to summary |
|---|---|
| public Drawable knob
| |
| TouchpadStyle | back to summary |
|---|---|
| public TouchpadStyle() | |
| TouchpadStyle | back to summary |
|---|---|
| public TouchpadStyle(Drawable background, Drawable knob) | |
| TouchpadStyle | back to summary |
|---|---|
| public TouchpadStyle(Touchpad. | |