|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.Group
public class Group
A group is an Actor that contains other Actors (also other Groups which are Actors).
Field Summary | |
---|---|
protected Matrix4 |
batchTransform
|
protected java.util.List<Actor> |
children
|
static boolean |
debug
|
static Texture |
debugTexture
|
Actor[] |
focusedActor
|
protected java.util.List<Group> |
groups
|
protected java.util.List<Actor> |
immutableChildren
|
protected java.util.List<Group> |
immutableGroups
|
Actor |
keyboardFocusedActor
|
Actor |
lastTouchedChild
|
protected Matrix3 |
localTransform
|
protected ObjectMap<java.lang.String,Actor> |
namesToActors
|
protected Matrix4 |
oldBatchTransform
|
protected Vector2 |
point
|
Actor |
scrollFocusedActor
|
boolean |
transform
|
protected Matrix3 |
worldTransform
|
Fields inherited from class com.badlogic.gdx.scenes.scene2d.Actor |
---|
actions, color, height, name, originX, originY, parent, rotation, scaleX, scaleY, touchable, visible, width, x, y |
Constructor Summary | |
---|---|
Group()
|
|
Group(java.lang.String name)
Creates a new Group with the given name. |
Method Summary | |
---|---|
void |
act(float delta)
|
void |
addActor(Actor actor)
Adds an Actor to this Group. |
void |
addActorAfter(Actor actorAfter,
Actor actor)
Adds an Actor after the given Actor. |
void |
addActorAt(int index,
Actor actor)
Adds an Actor at the given index in the group. |
void |
addActorBefore(Actor actorBefore,
Actor actor)
Adds an Actor before the given Actor. |
protected void |
applyTransform(SpriteBatch batch)
|
void |
clear()
Clears this Group, removing all contained Actor s. |
static void |
disableDebugging()
|
void |
draw(SpriteBatch batch,
float parentAlpha)
Draws the Actor. |
protected void |
drawChild(Actor child,
SpriteBatch batch,
float parentAlpha)
|
protected void |
drawChildren(SpriteBatch batch,
float parentAlpha)
|
static void |
enableDebugging(java.lang.String debugTextureFile)
|
Actor |
findActor(java.lang.String name)
Finds the Actor with the given name in this Group and its children. |
void |
focus(Actor actor,
int pointer)
Sets the focus to the given child Actor . |
java.util.List<Actor> |
getActors()
|
java.util.List<Group> |
getGroups()
|
Actor |
hit(float x,
float y)
|
void |
keyboardFocus(Actor actor)
Sets the keyboard focus to the given child Actor . |
boolean |
keyDown(int keycode)
|
boolean |
keyTyped(char character)
|
boolean |
keyUp(int keycode)
|
void |
removeActor(Actor actor)
Removes an Actor from this Group. |
void |
removeActorRecursive(Actor actor)
Removes an Actor from this Group recursively by checking if the Actor is in this group or one of its child-groups. |
protected void |
resetTransform(SpriteBatch batch)
|
boolean |
scrolled(int amount)
|
void |
scrollFocus(Actor actor)
Sets the scroll focus to the given child Actor . |
void |
sortChildren(java.util.Comparator<Actor> comparator)
Sorts the children via the given Comparator . |
boolean |
swapActor(Actor first,
Actor second)
Swap two actors' sort order by reference. |
boolean |
swapActor(int first,
int second)
Swap two actors' sort order by index. |
static void |
toChildCoordinates(Actor child,
float x,
float y,
Vector2 out)
Transforms the coordinates given in the child's parent coordinate system to the child Actor 's coordinate system. |
boolean |
touchDown(float x,
float y,
int pointer)
|
void |
touchDragged(float x,
float y,
int pointer)
|
boolean |
touchMoved(float x,
float y)
|
void |
touchUp(float x,
float y,
int pointer)
|
void |
unfocusAll()
Unfocuses all Actor instance currently focused for touch and keyboard events. |
void |
unfocusAll(Actor actor)
Unfocuses this Actor from the touch, keyboard and scroll focus from this group and all groups above it. |
protected Matrix4 |
updateTransform()
|
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor |
---|
action, clearActions, isMarkedToRemove, markToRemove, remove, toLocalCoordinates, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static Texture debugTexture
public static boolean debug
protected final java.util.List<Actor> children
protected final java.util.List<Actor> immutableChildren
protected final java.util.List<Group> groups
protected final java.util.List<Group> immutableGroups
protected final ObjectMap<java.lang.String,Actor> namesToActors
protected final Matrix3 localTransform
protected final Matrix3 worldTransform
protected final Matrix4 batchTransform
protected final Matrix4 oldBatchTransform
public boolean transform
public Actor lastTouchedChild
public Actor[] focusedActor
public Actor keyboardFocusedActor
public Actor scrollFocusedActor
protected final Vector2 point
Constructor Detail |
---|
public Group()
public Group(java.lang.String name)
name
- the name of the groupMethod Detail |
---|
public void act(float delta)
act
in class Actor
public void draw(SpriteBatch batch, float parentAlpha)
Actor
FadeIn
and
other Actions to have an effect even if they are only set on the parent of the Actor.
draw
in class Actor
batch
- the spritebatch to render withparentAlpha
- the parent's alpha value.protected void drawChildren(SpriteBatch batch, float parentAlpha)
protected void drawChild(Actor child, SpriteBatch batch, float parentAlpha)
protected void applyTransform(SpriteBatch batch)
protected Matrix4 updateTransform()
protected void resetTransform(SpriteBatch batch)
public boolean touchDown(float x, float y, int pointer)
touchDown
in class Actor
public void touchUp(float x, float y, int pointer)
touchUp
in class Actor
public boolean touchMoved(float x, float y)
touchMoved
in class Actor
public void touchDragged(float x, float y, int pointer)
touchDragged
in class Actor
public boolean scrolled(int amount)
scrolled
in class Actor
public boolean keyDown(int keycode)
keyDown
in class Actor
public boolean keyUp(int keycode)
keyUp
in class Actor
public boolean keyTyped(char character)
keyTyped
in class Actor
public Actor hit(float x, float y)
hit
in class Actor
public void addActor(Actor actor)
Actor
to this Group. The order Actors are added is reversed for hit testing.
actor
- the Actorpublic void addActorAt(int index, Actor actor)
Actor
at the given index in the group. The first Actor added will be at index 0 and so on. Throws an
IndexOutOfBoundsException in case the index is invalid.
index
- the index to add the actor at.public void addActorBefore(Actor actorBefore, Actor actor)
Actor
before the given Actor.
actorBefore
- the Actor to add the other actor in front ofactor
- the Actor to addpublic void addActorAfter(Actor actorAfter, Actor actor)
Actor
after the given Actor.
actorAfter
- the Actor to add the other Actor behindactor
- the Actor to addpublic void removeActor(Actor actor)
Actor
from this Group.
actor
- public void removeActorRecursive(Actor actor)
Actor
from this Group recursively by checking if the Actor is in this group or one of its child-groups.
actor
- the Actorpublic Actor findActor(java.lang.String name)
Actor
with the given name in this Group and its children.
name
- the name of the Actor
public boolean swapActor(int first, int second)
first
- first Actor indexsecond
- second Actor index
public boolean swapActor(Actor first, Actor second)
first
- first Actorsecond
- second Actor
public java.util.List<Actor> getActors()
Actor
s as an ordered list.public java.util.List<Group> getGroups()
Group
s as an unordered list.public void focus(Actor actor, int pointer)
Actor
. All subsequent touch events with the given pointer id will be passed to
this child Actor. To unset the focus simply pass null.
actor
- the Actorpublic void keyboardFocus(Actor actor)
Actor
. All subsequent keyboard events will be passed to that actor. To
unfocus an actor simply pass null.
actor
- the Actorpublic void scrollFocus(Actor actor)
Actor
. All subsequent scroll events will be passed to that actor. To
unfocus an actor simply pass null.
actor
- the Actor.public void clear()
Actor
s.
public void sortChildren(java.util.Comparator<Actor> comparator)
Comparator
.
comparator
- the comparator.public void unfocusAll()
Actor
instance currently focused for touch and keyboard events. You should call this in case your app
resumes to clear up any pressed states. Make sure the Actors forget their states as well! This will be applied to all child
groups recursively.
public void unfocusAll(Actor actor)
Actor
from the touch, keyboard and scroll focus from this group and all groups above it.
actor
- the Actorpublic static void toChildCoordinates(Actor child, float x, float y, Vector2 out)
Actor
's coordinate system.
child
- the child Actorx
- the x-coordinate in the Group's coordinate systemy
- the y-coordinate in the Group's coordinate systemout
- the output Vector2
public static void enableDebugging(java.lang.String debugTextureFile)
public static void disableDebugging()
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |