本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.Group.getY方法的典型用法代码示例。如果您正苦于以下问题:Java Group.getY方法的具体用法?Java Group.getY怎么用?Java Group.getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.Group
的用法示例。
在下文中一共展示了Group.getY方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPositionAndSizeGui
import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
@Override
public float[] getPositionAndSizeGui(String name) {
IGui gui = GaiaSky.instance.mainGui;
Actor actor = gui.getGuiStage().getRoot().findActor(name);
if (actor != null) {
float x = actor.getX();
float y = actor.getY();
// x and y relative to parent, so we need to add coordinates of
// parents up to top
Group parent = actor.getParent();
while (parent != null) {
x += parent.getX();
y += parent.getY();
parent = parent.getParent();
}
return new float[] { x, y, actor.getWidth(), actor.getHeight() };
} else {
return null;
}
}
示例2: a
import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
public static Vector2 a(Actor paramActor)
{
Group localGroup = paramActor.getParent();
float f1 = 0.0F + paramActor.getX();
float f2 = 0.0F + paramActor.getY();
while (localGroup != null)
{
if ((localGroup instanceof Group))
{
f1 += localGroup.getX();
f2 += localGroup.getY();
}
localGroup = localGroup.getParent();
}
return new Vector2(f1, f2);
}
示例3: getValues
import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
@Override
public int getValues(Group target, int tweenType, float[] returnValues) {
switch (tweenType) {
case POSITION:
returnValues[0] = target.getX();
returnValues[1] = target.getY();
return 2;
case ROTATION:
returnValues[0] = target.getRotation();
return 1;
case SCALE:
returnValues[0] = target.getScaleX();
returnValues[1] = target.getScaleY();
return 2;
case X:
returnValues[0] = target.getX();
return 1;
case Y:
returnValues[0] = target.getY();
return 1;
case SCALE_X:
returnValues[0] = target.getScaleX();
return 1;
case SCALE_Y:
returnValues[0] = target.getScaleY();
return 1;
}
return 0;
}
示例4: execute
import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
@Override
public void execute(Entity target, ChangeParent effect) {
if (!(target instanceof EngineEntity)) {
Gdx.app.debug(CHANGE_PARENT_EXECUTOR,
"Can't execute effect - target is not of type EngineEntity");
return;
}
Object value = variablesManager.evaluateExpression(effect
.getNewParent());
EngineEntity newParent = null;
if (value instanceof EngineEntity) {
newParent = (EngineEntity) value;
} else if (value instanceof Array) {
Array array = (Array) value;
if (array.size > 0 && array.get(0) instanceof EngineEntity) {
newParent = (EngineEntity) array.get(0);
}
}
if (newParent == null) {
Gdx.app.debug(CHANGE_PARENT_EXECUTOR,
"Can't execute effect - new parent is not of type EngineEntity");
return;
}
EngineEntity child = (EngineEntity) target;
Group childGroup = child.getGroup();
Vector2 stageOrigin = new Vector2(childGroup.getX(), childGroup.getY());
stageOrigin = childGroup.localToStageCoordinates(stageOrigin);
childGroup.remove();
newParent.getGroup().addActor(childGroup);
Vector2 newLocalCoordinates = childGroup
.stageToLocalCoordinates(stageOrigin);
childGroup.setX(newLocalCoordinates.x);
childGroup.setY(newLocalCoordinates.y);
}