本文整理了Java中com.badlogic.gdx.scenes.scene2d.Group.getStage()
方法的一些代码示例,展示了Group.getStage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Group.getStage()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.Group
类名称:Group
方法名:getStage
暂无
代码示例来源:origin: libgdx/libgdx
/** Adds an actor as a child of this group, removing it from its previous parent. If the actor is already a child of this
* group, no changes are made. */
public void addActor (Actor actor) {
if (actor.parent != null) {
if (actor.parent == this) return;
actor.parent.removeActor(actor, false);
}
children.add(actor);
actor.setParent(this);
actor.setStage(getStage());
childrenChanged();
}
代码示例来源:origin: libgdx/libgdx
/** Adds an actor as a child of this group, removing it from its previous parent. If the actor is already a child of this
* group, no changes are made. */
public void addActor (Actor actor) {
if (actor.parent != null) {
if (actor.parent == this) return;
actor.parent.removeActor(actor, false);
}
children.add(actor);
actor.setParent(this);
actor.setStage(getStage());
childrenChanged();
}
代码示例来源:origin: libgdx/libgdx
/** Removes an actor from this group. If the actor will not be used again and has actions, they should be
* {@link Actor#clearActions() cleared} so the actions will be returned to their
* {@link Action#setPool(com.badlogic.gdx.utils.Pool) pool}, if any. This is not done automatically.
* @param unfocus If true, {@link Stage#unfocus(Actor)} is called.
* @return true if the actor was removed from this group. */
public boolean removeActor (Actor actor, boolean unfocus) {
if (!children.removeValue(actor, true)) return false;
if (unfocus) {
Stage stage = getStage();
if (stage != null) stage.unfocus(actor);
}
actor.setParent(null);
actor.setStage(null);
childrenChanged();
return true;
}
代码示例来源:origin: libgdx/libgdx
/** Removes an actor from this group. If the actor will not be used again and has actions, they should be
* {@link Actor#clearActions() cleared} so the actions will be returned to their
* {@link Action#setPool(com.badlogic.gdx.utils.Pool) pool}, if any. This is not done automatically.
* @param unfocus If true, {@link Stage#unfocus(Actor)} is called.
* @return true if the actor was removed from this group. */
public boolean removeActor (Actor actor, boolean unfocus) {
if (!children.removeValue(actor, true)) return false;
if (unfocus) {
Stage stage = getStage();
if (stage != null) stage.unfocus(actor);
}
actor.setParent(null);
actor.setStage(null);
childrenChanged();
return true;
}
代码示例来源:origin: libgdx/libgdx
/** Adds an actor as a child of this group immediately before another child actor, removing it from its previous parent. If the
* actor is already a child of this group, no changes are made. */
public void addActorBefore (Actor actorBefore, Actor actor) {
if (actor.parent != null) {
if (actor.parent == this) return;
actor.parent.removeActor(actor, false);
}
int index = children.indexOf(actorBefore, true);
children.insert(index, actor);
actor.setParent(this);
actor.setStage(getStage());
childrenChanged();
}
代码示例来源:origin: libgdx/libgdx
/** Adds an actor as a child of this group immediately before another child actor, removing it from its previous parent. If the
* actor is already a child of this group, no changes are made. */
public void addActorBefore (Actor actorBefore, Actor actor) {
if (actor.parent != null) {
if (actor.parent == this) return;
actor.parent.removeActor(actor, false);
}
int index = children.indexOf(actorBefore, true);
children.insert(index, actor);
actor.setParent(this);
actor.setStage(getStage());
childrenChanged();
}
代码示例来源:origin: libgdx/libgdx
/** Adds an actor as a child of this group at a specific index, removing it from its previous parent. If the actor is already a
* child of this group, no changes are made.
* @param index May be greater than the number of children. */
public void addActorAt (int index, Actor actor) {
if (actor.parent != null) {
if (actor.parent == this) return;
actor.parent.removeActor(actor, false);
}
if (index >= children.size)
children.add(actor);
else
children.insert(index, actor);
actor.setParent(this);
actor.setStage(getStage());
childrenChanged();
}
代码示例来源:origin: libgdx/libgdx
/** Adds an actor as a child of this group at a specific index, removing it from its previous parent. If the actor is already a
* child of this group, no changes are made.
* @param index May be greater than the number of children. */
public void addActorAt (int index, Actor actor) {
if (actor.parent != null) {
if (actor.parent == this) return;
actor.parent.removeActor(actor, false);
}
if (index >= children.size)
children.add(actor);
else
children.insert(index, actor);
actor.setParent(this);
actor.setStage(getStage());
childrenChanged();
}
代码示例来源:origin: libgdx/libgdx
/** Adds an actor as a child of this group immediately after another child actor, removing it from its previous parent. If the
* actor is already a child of this group, no changes are made. */
public void addActorAfter (Actor actorAfter, Actor actor) {
if (actor.parent != null) {
if (actor.parent == this) return;
actor.parent.removeActor(actor, false);
}
int index = children.indexOf(actorAfter, true);
if (index == children.size)
children.add(actor);
else
children.insert(index + 1, actor);
actor.setParent(this);
actor.setStage(getStage());
childrenChanged();
}
代码示例来源:origin: libgdx/libgdx
/** Adds an actor as a child of this group immediately after another child actor, removing it from its previous parent. If the
* actor is already a child of this group, no changes are made. */
public void addActorAfter (Actor actorAfter, Actor actor) {
if (actor.parent != null) {
if (actor.parent == this) return;
actor.parent.removeActor(actor, false);
}
int index = children.indexOf(actorAfter, true);
if (index == children.size)
children.add(actor);
else
children.insert(index + 1, actor);
actor.setParent(this);
actor.setStage(getStage());
childrenChanged();
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
/** Adds an actor as a child of this group, removing it from its previous parent. If the actor is already a child of this
* group, no changes are made. */
public void addActor (Actor actor) {
if (actor.parent != null) {
if (actor.parent == this) return;
actor.parent.removeActor(actor, false);
}
children.add(actor);
actor.setParent(this);
actor.setStage(getStage());
childrenChanged();
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
/** Removes an actor from this group. If the actor will not be used again and has actions, they should be
* {@link Actor#clearActions() cleared} so the actions will be returned to their
* {@link Action#setPool(com.badlogic.gdx.utils.Pool) pool}, if any. This is not done automatically.
* @param unfocus If true, {@link Stage#unfocus(Actor)} is called.
* @return true if the actor was removed from this group. */
public boolean removeActor (Actor actor, boolean unfocus) {
if (!children.removeValue(actor, true)) return false;
if (unfocus) {
Stage stage = getStage();
if (stage != null) stage.unfocus(actor);
}
actor.setParent(null);
actor.setStage(null);
childrenChanged();
return true;
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
/** Adds an actor as a child of this group immediately before another child actor, removing it from its previous parent. If the
* actor is already a child of this group, no changes are made. */
public void addActorBefore (Actor actorBefore, Actor actor) {
if (actor.parent != null) {
if (actor.parent == this) return;
actor.parent.removeActor(actor, false);
}
int index = children.indexOf(actorBefore, true);
children.insert(index, actor);
actor.setParent(this);
actor.setStage(getStage());
childrenChanged();
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
/** Adds an actor as a child of this group at a specific index, removing it from its previous parent. If the actor is already a
* child of this group, no changes are made.
* @param index May be greater than the number of children. */
public void addActorAt (int index, Actor actor) {
if (actor.parent != null) {
if (actor.parent == this) return;
actor.parent.removeActor(actor, false);
}
if (index >= children.size)
children.add(actor);
else
children.insert(index, actor);
actor.setParent(this);
actor.setStage(getStage());
childrenChanged();
}
代码示例来源:origin: com.badlogicgames.gdx/gdx
/** Adds an actor as a child of this group immediately after another child actor, removing it from its previous parent. If the
* actor is already a child of this group, no changes are made. */
public void addActorAfter (Actor actorAfter, Actor actor) {
if (actor.parent != null) {
if (actor.parent == this) return;
actor.parent.removeActor(actor, false);
}
int index = children.indexOf(actorAfter, true);
if (index == children.size)
children.add(actor);
else
children.insert(index + 1, actor);
actor.setParent(this);
actor.setStage(getStage());
childrenChanged();
}
内容来源于网络,如有侵权,请联系作者删除!