当前位置: 首页>>代码示例>>Java>>正文


Java Group.getY方法代码示例

本文整理汇总了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;
    }

}
 
开发者ID:langurmonkey,项目名称:gaiasky,代码行数:22,代码来源:EventScriptingInterface.java

示例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);
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:17,代码来源:b.java

示例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;
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:30,代码来源:GroupAccessor.java

示例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);
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:38,代码来源:ChangeParentExecutor.java


注:本文中的com.badlogic.gdx.scenes.scene2d.Group.getY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。