An actor has a list of in progress actions that are applied to the actor (often over time). These are generally
used to change the presentation of the actor (moving it, resizing it, etc). See act(float), Action, and its
many subclasses.
An actor has two kinds of listeners associated with it: "capture" and regular. The listeners are notified of events the actor
or its children receive. The regular listeners are designed to allow an actor to respond to events that have been delivered.
The capture listeners are designed to allow a parent or container actor to handle events before child actors. See fire
for more details.
An InputListener can receive all the basic input events. More complex listeners (like ClickListener and
ActorGestureListener) can listen for and combine primitive events and recognize complex interactions like multi-touch
or pinch.
| Modifier and Type | Field and Description |
|---|---|
| private final Array | |
| private final DelayedRemovalArray | |
| pack-priv final Color | |
| private boolean | |
| pack-priv float | |
| private final DelayedRemovalArray | |
| private String | |
| pack-priv float | |
| pack-priv float | |
| pack-priv Group | |
| public static PoolManager | |
| pack-priv float | |
| pack-priv float | |
| pack-priv float | |
| private Stage | |
| private Touchable | |
| private Object | |
| private boolean | |
| pack-priv float | |
| pack-priv float | |
| pack-priv float |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public boolean | addCaptureListener(EventListener listener)
Adds a listener that is only notified during the capture phase. |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | |
| public void | |
| public void | |
| public boolean | |
| public boolean | Returns: false if the clipping area is zero and no drawing should occur.Clips the specified screen aligned rectangle, specified relative to the transform matrix of the stage's Batch. |
| public void | |
| public Actor | |
| public void | |
| public void | |
| protected void | drawDebugBounds(ShapeRenderer shapes)
Draws a rectangle for the bounds of this actor if |
| public boolean | |
| public <T extends Actor> T | firstAscendant(Class<T> type)
Returns this actor or the first ascendant of this actor that is assignable with the specified type, or null if none were found. |
| public Array | |
| public DelayedRemovalArray | |
| public Color | |
| public boolean | |
| public float | |
| public DelayedRemovalArray | |
| public String | |
| public float | |
| public float | |
| public Group | |
| public float | |
| public float | |
| public float | |
| public float | |
| public Stage | |
| public float | |
| public Touchable | |
| public Object | |
| public float | |
| public float | |
| public float | |
| public float | |
| public float | |
| public int | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public Actor | hit(float x, float y, boolean
If true, hit detection will respect the touchable)touchability.Returns the deepest |
| public boolean | isAscendantOf(Actor actor)
Returns true if this actor is the same as or is the ascendant of the specified actor. |
| public boolean | isDescendantOf(Actor actor)
Returns true if this actor is the same as or is the descendant of the specified actor. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public Vector2 | localToActorCoordinates(Actor actor, Vector2 localCoords)
Converts coordinates for this actor to those of another actor, which can be anywhere in the stage. |
| public Vector2 | localToAscendantCoordinates(Actor ascendant, Vector2 localCoords)
Converts coordinates for this actor to those of an ascendant. |
| public Vector2 | localToParentCoordinates(Vector2 localCoords)
Transforms the specified point in the actor's coordinates to be in the parent's coordinates. |
| public Vector2 | localToScreenCoordinates(Vector2 localCoords)
Transforms the specified point in the actor's coordinates to be in screen coordinates. |
| public Vector2 | localToStageCoordinates(Vector2 localCoords)
Transforms the specified point in the actor's coordinates to be in the stage's coordinates. |
| public void | |
| public boolean | |
| public Vector2 | parentToLocalCoordinates(Vector2 parentCoords)
Converts the coordinates given in the parent's coordinate system to this actor's coordinate system. |
| protected void | |
| public boolean | |
| public void | |
| public boolean | |
| public boolean | |
| public void | |
| protected void | |
| public void | |
| public void | |
| protected void | |
| public Vector2 | screenToLocalCoordinates(Vector2 screenCoords)
Transforms the specified point in screen coordinates to the actor's local coordinate system. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setName(String
May be null. name)Set the actor's name, which is used for identification convenience and by |
| public void | setOrigin(float originX, float originY)
Sets the origin position which is relative to the actor's bottom left corner. |
| public void | |
| public void | |
| public void | |
| protected void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| protected void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public boolean | |
| public void | |
| public void | |
| protected void | |
| public Vector2 | stageToLocalCoordinates(Vector2 stageCoords)
Transforms the specified point in the stage's coordinates to the actor's local coordinate system. |
| public void | |
| public void | |
| public String |
| actions | back to summary |
|---|---|
| private final Array<Action> actions | |
| captureListeners | back to summary |
|---|---|
| private final DelayedRemovalArray<EventListener> captureListeners | |
| color | back to summary |
|---|---|
| pack-priv final Color color | |
| debug | back to summary |
|---|---|
| private boolean debug | |
| height | back to summary |
|---|---|
| pack-priv float height | |
| listeners | back to summary |
|---|---|
| private final DelayedRemovalArray<EventListener> listeners | |
| name | back to summary |
|---|---|
| private String name
| |
| originX | back to summary |
|---|---|
| pack-priv float originX | |
| originY | back to summary |
|---|---|
| pack-priv float originY | |
| parent | back to summary |
|---|---|
| pack-priv Group parent
| |
| POOLS | back to summary |
|---|---|
| public static PoolManager POOLS | |
| rotation | back to summary |
|---|---|
| pack-priv float rotation | |
| scaleX | back to summary |
|---|---|
| pack-priv float scaleX | |
| scaleY | back to summary |
|---|---|
| pack-priv float scaleY | |
| stage | back to summary |
|---|---|
| private Stage stage
| |
| touchable | back to summary |
|---|---|
| private Touchable touchable | |
| userObject | back to summary |
|---|---|
| private Object userObject
| |
| visible | back to summary |
|---|---|
| private boolean visible | |
| width | back to summary |
|---|---|
| pack-priv float width | |
| x | back to summary |
|---|---|
| pack-priv float x | |
| y | back to summary |
|---|---|
| pack-priv float y | |
| Actor | back to summary |
|---|---|
| public Actor() | |
| act | back to summary |
|---|---|
| public void act(float delta) Updates the actor based on time. Typically this is called each frame by
The default implementation calls
| |
| addAction | back to summary |
|---|---|
| public void addAction(Action action) | |
| addCaptureListener | back to summary |
|---|---|
| public boolean addCaptureListener(EventListener listener) Adds a listener that is only notified during the capture phase.
| |
| addListener | back to summary |
|---|---|
| public boolean addListener(EventListener listener) Add a listener to receive events that
| |
| ancestorsVisible | back to summary |
|---|---|
| public boolean ancestorsVisible()
Deprecated Use
| |
| ascendantsVisible | back to summary |
|---|---|
| public boolean ascendantsVisible() Returns true if this actor and all ascendants are visible. | |
| clear | back to summary |
|---|---|
| public void clear() Removes all actions and listeners on this actor. | |
| clearActions | back to summary |
|---|---|
| public void clearActions() Removes all actions on this actor. | |
| clearListeners | back to summary |
|---|---|
| public void clearListeners() Removes all listeners on this actor. | |
| clipBegin | back to summary |
|---|---|
| public boolean clipBegin() Calls | |
| clipBegin | back to summary |
|---|---|
| public boolean clipBegin(float x, float y, float width, float height) Clips the specified screen aligned rectangle, specified relative to the transform matrix of the stage's Batch. The
transform matrix and the stage's camera must not have rotational components. Calling this method must be followed by a call
to
| |
| clipEnd | back to summary |
|---|---|
| public void clipEnd() Ends clipping begun by | |
| debug | back to summary |
|---|---|
| public Actor debug() Calls | |
| draw | back to summary |
|---|---|
| public void draw(Batch batch, float parentAlpha) Draws the actor. The batch is configured to draw in the parent's coordinate system.
The default implementation does nothing.
| |
| drawDebug | back to summary |
|---|---|
| public void drawDebug(ShapeRenderer shapes) Draws this actor's debug lines if | |
| drawDebugBounds | back to summary |
|---|---|
| protected void drawDebugBounds(ShapeRenderer shapes) Draws a rectangle for the bounds of this actor if | |
| fire | back to summary |
|---|---|
| public boolean fire(Event event) Sets this actor as the event Events are fired in 2 phases:
stopped at any time, it will not propagate to the next actor.
| |
| firstAscendant | back to summary |
|---|---|
| public <T extends Actor> T firstAscendant(Class<T> type) Returns this actor or the first ascendant of this actor that is assignable with the specified type, or null if none were found.
| |
| getActions | back to summary |
|---|---|
| public Array | |
| getCaptureListeners | back to summary |
|---|---|
| public DelayedRemovalArray | |
| getColor | back to summary |
|---|---|
| public Color getColor() Returns the color the actor will be tinted when drawn. The returned instance can be modified to change the color. | |
| getDebug | back to summary |
|---|---|
| public boolean getDebug() | |
| getHeight | back to summary |
|---|---|
| public float getHeight() | |
| getListeners | back to summary |
|---|---|
| public DelayedRemovalArray | |
| getName | back to summary |
|---|---|
public String getName()
| |
| getOriginX | back to summary |
|---|---|
| public float getOriginX() | |
| getOriginY | back to summary |
|---|---|
| public float getOriginY() | |
| getParent | back to summary |
|---|---|
| public Group getParent() Returns the parent actor, or null if not in a group.
| |
| getRight | back to summary |
|---|---|
| public float getRight() Returns x plus width. | |
| getRotation | back to summary |
|---|---|
| public float getRotation() | |
| getScaleX | back to summary |
|---|---|
| public float getScaleX() | |
| getScaleY | back to summary |
|---|---|
| public float getScaleY() | |
| getStage | back to summary |
|---|---|
| public Stage getStage() Returns the stage that this actor is currently in, or null if not in a stage.
| |
| getTop | back to summary |
|---|---|
| public float getTop() Returns y plus height. | |
| getTouchable | back to summary |
|---|---|
| public Touchable getTouchable() | |
| getUserObject | back to summary |
|---|---|
| public Object getUserObject() Returns an application specific object for convenience, or null.
| |
| getWidth | back to summary |
|---|---|
| public float getWidth() | |
| getX | back to summary |
|---|---|
| public float getX() Returns the X position of the actor's left edge. | |
| getX | back to summary |
|---|---|
| public float getX(int alignment) Returns the X position of the specified | |
| getY | back to summary |
|---|---|
| public float getY() Returns the Y position of the actor's bottom edge. | |
| getY | back to summary |
|---|---|
| public float getY(int alignment) Returns the Y position of the specified | |
| getZIndex | back to summary |
|---|---|
| public int getZIndex() Returns the z-index of this actor, or -1 if the actor is not in a group.
| |
| hasActions | back to summary |
|---|---|
| public boolean hasActions() Returns true if the actor has one or more actions. | |
| hasKeyboardFocus | back to summary |
|---|---|
| public boolean hasKeyboardFocus() Returns true if this actor is the | |
| hasParent | back to summary |
|---|---|
| public boolean hasParent() Returns true if the actor's parent is not null. | |
| hasScrollFocus | back to summary |
|---|---|
| public boolean hasScrollFocus() Returns true if this actor is the | |
| hit | back to summary |
|---|---|
| public Actor hit(float x, float y, boolean touchable) 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.
| |
| isAscendantOf | back to summary |
|---|---|
| public boolean isAscendantOf(Actor actor) Returns true if this actor is the same as or is the ascendant of the specified actor. | |
| isDescendantOf | back to summary |
|---|---|
| public boolean isDescendantOf(Actor actor) Returns true if this actor is the same as or is the descendant of the specified actor. | |
| isTouchable | back to summary |
|---|---|
| public boolean isTouchable() Returns true if input events are processed by this actor. | |
| isTouchFocusListener | back to summary |
|---|---|
| public boolean isTouchFocusListener() Returns true if this actor is a listener actor for touch focus. | |
| isTouchFocusTarget | back to summary |
|---|---|
| public boolean isTouchFocusTarget() Returns true if this actor is a target actor for touch focus. | |
| isVisible | back to summary |
|---|---|
| public boolean isVisible() | |
| localToActorCoordinates | back to summary |
|---|---|
| public Vector2 localToActorCoordinates(Actor actor, Vector2 localCoords) Converts coordinates for this actor to those of another actor, which can be anywhere in the stage. | |
| localToAscendantCoordinates | back to summary |
|---|---|
| public Vector2 localToAscendantCoordinates(Actor ascendant, Vector2 localCoords) Converts coordinates for this actor to those of an ascendant. The ascendant is not required to be the immediate parent.
| |
| localToParentCoordinates | back to summary |
|---|---|
| public Vector2 localToParentCoordinates(Vector2 localCoords) Transforms the specified point in the actor's coordinates to be in the parent's coordinates. | |
| localToScreenCoordinates | back to summary |
|---|---|
| public Vector2 localToScreenCoordinates(Vector2 localCoords) Transforms the specified point in the actor's coordinates to be in screen coordinates. | |
| localToStageCoordinates | back to summary |
|---|---|
| public Vector2 localToStageCoordinates(Vector2 localCoords) Transforms the specified point in the actor's coordinates to be in the stage's coordinates. | |
| moveBy | back to summary |
|---|---|
| public void moveBy(float x, float y) Add x and y to current position | |
| notify | back to summary |
|---|---|
| public boolean notify(Event event, boolean capture) Notifies this actor's listeners of the event. The event is not propagated to any ascendants. The event
| |
| parentToLocalCoordinates | back to summary |
|---|---|
| public Vector2 parentToLocalCoordinates(Vector2 parentCoords) Converts the coordinates given in the parent's coordinate system to this actor's coordinate system. | |
| positionChanged | back to summary |
|---|---|
| protected void positionChanged() Called when the actor's position has been changed. | |
| remove | back to summary |
|---|---|
| public boolean remove() Removes this actor from its parent, if it has a parent.
| |
| removeAction | back to summary |
|---|---|
public void removeAction(Action action)
| |
| removeCaptureListener | back to summary |
|---|---|
| public boolean removeCaptureListener(EventListener listener) | |
| removeListener | back to summary |
|---|---|
| public boolean removeListener(EventListener listener) | |
| rotateBy | back to summary |
|---|---|
| public void rotateBy(float amountInDegrees) Adds the specified rotation to the current rotation. | |
| rotationChanged | back to summary |
|---|---|
| protected void rotationChanged() Called when the actor's rotation has been changed. | |
| scaleBy | back to summary |
|---|---|
| public void scaleBy(float scale) Adds the specified scale to the current scale. | |
| scaleBy | back to summary |
|---|---|
| public void scaleBy(float scaleX, float scaleY) Adds the specified scale to the current scale. | |
| scaleChanged | back to summary |
|---|---|
| protected void scaleChanged() Called when the actor's scale has been changed. | |
| screenToLocalCoordinates | back to summary |
|---|---|
| public Vector2 screenToLocalCoordinates(Vector2 screenCoords) Transforms the specified point in screen coordinates to the actor's local coordinate system. | |
| setBounds | back to summary |
|---|---|
| public void setBounds(float x, float y, float width, float height) Set bounds the x, y, width, and height. | |
| setColor | back to summary |
|---|---|
| public void setColor(Color color) | |
| setColor | back to summary |
|---|---|
| public void setColor(float r, float g, float b, float a) | |
| setDebug | back to summary |
|---|---|
| public void setDebug(boolean enabled) If true, | |
| setHeight | back to summary |
|---|---|
| public void setHeight(float height) | |
| setName | back to summary |
|---|---|
| public void setName(String name) Set the actor's name, which is used for identification convenience and by
| |
| setOrigin | back to summary |
|---|---|
| public void setOrigin(float originX, float originY) Sets the origin position which is relative to the actor's bottom left corner. | |
| setOrigin | back to summary |
|---|---|
| public void setOrigin(int alignment) Sets the origin position to the specified | |
| setOriginX | back to summary |
|---|---|
| public void setOriginX(float originX) | |
| setOriginY | back to summary |
|---|---|
| public void setOriginY(float originY) | |
| setParent | back to summary |
|---|---|
| protected void setParent(Group parent) Called by the framework when an actor is added to or removed from a group.
| |
| setPosition | back to summary |
|---|---|
| public void setPosition(float x, float y) Sets the position of the actor's bottom left corner. | |
| setPosition | back to summary |
|---|---|
| public void setPosition(float x, float y, int alignment) Sets the position using the specified | |
| setRotation | back to summary |
|---|---|
| public void setRotation(float degrees) | |
| setScale | back to summary |
|---|---|
| public void setScale(float scaleXY) Sets the scale for both X and Y | |
| setScale | back to summary |
|---|---|
| public void setScale(float scaleX, float scaleY) Sets the scale X and scale Y. | |
| setScaleX | back to summary |
|---|---|
| public void setScaleX(float scaleX) | |
| setScaleY | back to summary |
|---|---|
| public void setScaleY(float scaleY) | |
| setSize | back to summary |
|---|---|
| public void setSize(float width, float height) Sets the width and height. | |
| setStage | back to summary |
|---|---|
| protected void setStage(Stage stage) Called by the framework when this actor or any ascendant is added to a group that is in the stage.
| |
| setTouchable | back to summary |
|---|---|
| public void setTouchable(Touchable touchable) Determines how touch events are distributed to this actor. Default is | |
| setUserObject | back to summary |
|---|---|
| public void setUserObject(Object userObject) Sets an application specific object for convenience. | |
| setVisible | back to summary |
|---|---|
| public void setVisible(boolean visible) If false, the actor will not be drawn and will not receive touch events. Default is true. | |
| setWidth | back to summary |
|---|---|
| public void setWidth(float width) | |
| setX | back to summary |
|---|---|
| public void setX(float x) | |
| setX | back to summary |
|---|---|
| public void setX(float x, int alignment) Sets the x position using the specified | |
| setY | back to summary |
|---|---|
| public void setY(float y) | |
| setY | back to summary |
|---|---|
| public void setY(float y, int alignment) Sets the y position using the specified | |
| setZIndex | back to summary |
|---|---|
| public boolean setZIndex(int index) Sets the z-index of this actor. The z-index is the index into the parent's
| |
| sizeBy | back to summary |
|---|---|
| public void sizeBy(float size) Adds the specified size to the current size. | |
| sizeBy | back to summary |
|---|---|
| public void sizeBy(float width, float height) Adds the specified size to the current size. | |
| sizeChanged | back to summary |
|---|---|
| protected void sizeChanged() Called when the actor's size has been changed. | |
| stageToLocalCoordinates | back to summary |
|---|---|
| public Vector2 stageToLocalCoordinates(Vector2 stageCoords) Transforms the specified point in the stage's coordinates to the actor's local coordinate system. | |
| toBack | back to summary |
|---|---|
| public void toBack() Changes the z-order for this actor so it is in back of all siblings. | |
| toFront | back to summary |
|---|---|
| public void toFront() Changes the z-order for this actor so it is in front of all siblings. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |