本文整理汇总了Java中com.badlogic.gdx.utils.SnapshotArray.get方法的典型用法代码示例。如果您正苦于以下问题:Java SnapshotArray.get方法的具体用法?Java SnapshotArray.get怎么用?Java SnapshotArray.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.utils.SnapshotArray
的用法示例。
在下文中一共展示了SnapshotArray.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: markPlayerAsReady
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
/**
* Visually indicate that a player has been marked as ready.
*
* @param username username of the ready player
*/
private void markPlayerAsReady(String username) {
// Find the table row containing the player that has been marked as ready
final SnapshotArray<Actor> children = playersTable.getChildren();
// Ignore the first child since it's just the table header
for (int i = 1; i < children.size; i++) {
Actor actor = children.get(i);
if (actor instanceof Table) {
final Actor label = ((Table) actor).getCells().get(0).getActor();
if (label instanceof Label) {
if (((Label) label).getText().toString().equals(username)) {
((Table) actor).setBackground("readyBackground");
break;
}
}
}
}
}
示例2: removePlayer
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
/**
* Remove a player from the list of players as a result of him/her leaving
* the game.
*
* @param username username of the player
*/
private void removePlayer(String username) {
Table playerTable = null;
// Find the table row containing the player that left the game
final SnapshotArray<Actor> children = playersTable.getChildren();
// Ignore the first child since it's just the table header
for (int i = 1; i < children.size; i++) {
Actor actor = children.get(i);
if (actor instanceof Table) {
final Actor label = ((Table) actor).getCells().get(0).getActor();
if (label instanceof Label) {
if (((Label) label).getText().toString().equals(username)) {
playerTable = ((Table) actor);
break;
}
}
}
}
if (playerTable != null)
playersTable.removeActor(playerTable);
}
示例3: onShow
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public void onShow() {
SnapshotArray<Actor> childs = this.getChildren();
if (childs != null && childs.size > 0) {
try {
for (int i = 0, n = childs.size; i < n; i++) {
// alle renderChilds() der in dieser CB_View_Base
// enthaltenen Childs auf rufen.
if (childs.get(i) instanceof CB_View_Base) {
CB_View_Base view = (CB_View_Base) childs.get(i);
if (view != null)
view.onShow();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例4: onHide
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public void onHide() {
SnapshotArray<Actor> childs = this.getChildren();
if (childs != null && childs.size > 0) {
try {
for (int i = 0, n = childs.size; i < n; i++) {
// alle renderChilds() der in dieser GL_View_Base
// enthaltenen Childs auf rufen.
if (childs.get(i) instanceof CB_View_Base) {
CB_View_Base view = (CB_View_Base) childs.get(i);
if (view != null)
view.onHide();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例5: computeSize
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
private void computeSize() {
sizeInvalid = false;
maxWidth = minWidth = prefWidth = getStage().getWidth() - 5;
maxHeight = minHeight = prefHeight = 0;
SnapshotArray<Actor> children = getChildren();
for (int i = 0, n = children.size; i < n; i++) {
Actor child = children.get(i);
if (!child.isVisible()) {
continue;
}
if (child instanceof Layout) {
Layout layout = (Layout) child;
prefHeight += layout.getPrefHeight();
minHeight += layout.getMinHeight();
} else {
prefHeight += child.getHeight();
minHeight += child.getHeight();
}
}
}
示例6: computeSize
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
private void computeSize () {
sizeInvalid = false;
SnapshotArray<Actor> children = getChildren();
int n = children.size;
prefWidth = 0;
prefHeight = padTop + padBottom + spacing * (n - 1);
for (int i = 0; i < n; i++) {
Actor child = children.get(i);
if (child instanceof Layout) {
Layout layout = (Layout)child;
prefWidth = Math.max(prefWidth, layout.getPrefWidth());
prefHeight += layout.getPrefHeight();
} else {
prefWidth = Math.max(prefWidth, child.getWidth());
prefHeight += child.getHeight();
}
}
prefWidth += padLeft + padRight;
if (round) {
prefWidth = Math.round(prefWidth);
prefHeight = Math.round(prefHeight);
}
}
示例7: computeSize
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
private void computeSize () {
sizeInvalid = false;
SnapshotArray<Actor> children = getChildren();
int n = children.size;
prefWidth = padLeft + padRight + spacing * (n - 1);
prefHeight = 0;
for (int i = 0; i < n; i++) {
Actor child = children.get(i);
if (child instanceof Layout) {
Layout layout = (Layout)child;
prefWidth += layout.getPrefWidth();
prefHeight = Math.max(prefHeight, layout.getPrefHeight());
} else {
prefWidth += child.getWidth();
prefHeight = Math.max(prefHeight, child.getHeight());
}
}
prefHeight += padTop + padBottom;
if (round) {
prefWidth = Math.round(prefWidth);
prefHeight = Math.round(prefHeight);
}
}
示例8: hit
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public Actor hit(float paramFloat1, float paramFloat2)
{
Actor localActor2;
if (getTouchable() == Touchable.disabled)
{
localActor2 = null;
return localActor2;
}
SnapshotArray localSnapshotArray = this.children;
for (int i = -1 + localSnapshotArray.size; ; i--)
{
if (i < 0)
break label99;
Actor localActor1 = (Actor)localSnapshotArray.get(i);
if (localActor1.isVisible())
{
localActor1.parentToLocalCoordinates(this.point.set(paramFloat1, paramFloat2));
localActor2 = localActor1.hit(this.point.x, this.point.y);
if (localActor2 != null)
break;
}
}
label99: return super.hit(paramFloat1, paramFloat2);
}
示例9: getMinHeight
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public float getMinHeight()
{
SnapshotArray localSnapshotArray = getChildren();
int i = localSnapshotArray.size;
float f1 = 0.0F;
int j = 0;
if (j < i)
{
Actor localActor = (Actor)localSnapshotArray.get(j);
if ((localActor instanceof Layout));
for (float f2 = ((Layout)localActor).getMinHeight(); ; f2 = localActor.getHeight())
{
f1 = Math.max(f1, f2);
j++;
break;
}
}
return f1 * getScaleY();
}
示例10: getMinWidth
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public float getMinWidth()
{
SnapshotArray localSnapshotArray = getChildren();
int i = localSnapshotArray.size;
float f1 = 0.0F;
int j = 0;
if (j < i)
{
Actor localActor = (Actor)localSnapshotArray.get(j);
if ((localActor instanceof Layout));
for (float f2 = ((Layout)localActor).getMinWidth(); ; f2 = localActor.getWidth())
{
f1 = Math.max(f1, f2);
j++;
break;
}
}
return f1 * getScaleX();
}
示例11: getPrefHeight
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public float getPrefHeight()
{
SnapshotArray localSnapshotArray = getChildren();
int i = localSnapshotArray.size;
float f1 = 0.0F;
int j = 0;
if (j < i)
{
Actor localActor = (Actor)localSnapshotArray.get(j);
if ((localActor instanceof Layout));
for (float f2 = ((Layout)localActor).getPrefHeight(); ; f2 = localActor.getHeight())
{
f1 = Math.max(f1, f2);
j++;
break;
}
}
return f1 * getScaleY();
}
示例12: getPrefWidth
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public float getPrefWidth()
{
SnapshotArray localSnapshotArray = getChildren();
int i = localSnapshotArray.size;
float f1 = 0.0F;
int j = 0;
if (j < i)
{
Actor localActor = (Actor)localSnapshotArray.get(j);
if ((localActor instanceof Layout));
for (float f2 = ((Layout)localActor).getPrefWidth(); ; f2 = localActor.getWidth())
{
f1 = Math.max(f1, f2);
j++;
break;
}
}
return f1 * getScaleX();
}
示例13: layout
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public void layout()
{
SnapshotArray localSnapshotArray = getChildren();
int i = localSnapshotArray.size;
for (int j = 0; j < i; j++)
{
Actor localActor = (Actor)localSnapshotArray.get(j);
localActor.setBounds(0.0F, 0.0F, getWidth(), getHeight());
if ((localActor instanceof Layout))
{
Layout localLayout = (Layout)localActor;
localLayout.invalidate();
localLayout.validate();
}
}
}
示例14: setLayoutEnabled
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
private void setLayoutEnabled(Group paramGroup, boolean paramBoolean)
{
SnapshotArray localSnapshotArray = getChildren();
int i = localSnapshotArray.size;
int j = 0;
if (j < i)
{
Actor localActor = (Actor)localSnapshotArray.get(j);
if ((localActor instanceof Layout))
((Layout)localActor).setLayoutEnabled(paramBoolean);
while (true)
{
j++;
break;
if ((localActor instanceof Group))
setLayoutEnabled((Group)localActor, paramBoolean);
}
}
}
示例15: cancelTouchFocus
import com.badlogic.gdx.utils.SnapshotArray; //导入方法依赖的package包/类
public void cancelTouchFocus(EventListener paramEventListener, Actor paramActor)
{
InputEvent localInputEvent = (InputEvent)Pools.obtain(InputEvent.class);
localInputEvent.setStage(this);
localInputEvent.setType(InputEvent.Type.touchUp);
localInputEvent.setStageX(-2.147484E+09F);
localInputEvent.setStageY(-2.147484E+09F);
SnapshotArray localSnapshotArray = this.touchFocuses;
for (int i = -1 + localSnapshotArray.size; i >= 0; i--)
{
Stage.TouchFocus localTouchFocus = (Stage.TouchFocus)localSnapshotArray.get(i);
if ((localTouchFocus.listener != paramEventListener) || (localTouchFocus.listenerActor != paramActor))
{
localInputEvent.setTarget(localTouchFocus.target);
localInputEvent.setListenerActor(localTouchFocus.listenerActor);
localInputEvent.setPointer(localTouchFocus.pointer);
localInputEvent.setButton(localTouchFocus.button);
localSnapshotArray.removeIndex(i);
localTouchFocus.listener.handle(localInputEvent);
}
}
Pools.free(localInputEvent);
}