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


Java Group.setPosition方法代码示例

本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.Group.setPosition方法的典型用法代码示例。如果您正苦于以下问题:Java Group.setPosition方法的具体用法?Java Group.setPosition怎么用?Java Group.setPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.scenes.scene2d.Group的用法示例。


在下文中一共展示了Group.setPosition方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visualize

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
@Override public IFuture<Void> visualize(DroppedItem drop) {
    final Future<Void> future = new Future<Void>();

    Group group = new Group();
    Tile image = new Tile("item/" + drop.item.name);
    Label counter = new Label(String.valueOf(drop.count), Config.skin);
    counter.setSize(image.getWidth(), image.getHeight());
    counter.setAlignment(Align.right | Align.bottom);
    group.addActor(image);
    group.addActor(counter);
    group.setTransform(false);
    visualizer.viewController.notificationLayer.addActor(group);
    group.setPosition(drop.target.getX() * ViewController.CELL_SIZE, drop.target.getY() * ViewController.CELL_SIZE);
    group.addAction(Actions.parallel(
        Actions.moveBy(0, 30, 1f, Interpolation.fade),
        Actions.alpha(0, 1f, Interpolation.fade),
        Actions.delay(0.4f, Actions.run(new Runnable() {
            @Override public void run() {
                future.happen();
            }
        }))
    ));
    return future;
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:25,代码来源:DropVisualizer.java

示例2: setValues

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
@Override
public void setValues(Group target, int tweenType, float[] newValues) {
	switch (tweenType) {
	case POSITION:
		target.setPosition(newValues[0], newValues[1]);
		break;
	case ROTATION:
		target.setRotation(newValues[0]);
		break;
	case SCALE:
		target.setScale(newValues[0], newValues[1]);
		break;
	case X:
		target.setX(newValues[0]);
		break;
	case Y:
		target.setY(newValues[0]);
		break;
	case SCALE_X:
		target.setScaleX(newValues[0]);
		break;
	case SCALE_Y:
		target.setScaleY(newValues[0]);
		break;
	}
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:27,代码来源:GroupAccessor.java

示例3: readModelEntity

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void readModelEntity() {
	Group group = getGroup();
	if (group != null && modelEntity != null) {
		group.setName(modelEntity.getName());
		group.setPosition(modelEntity.getX(), modelEntity.getY());
		group.setOrigin(modelEntity.getOriginX(), modelEntity.getOriginY());
		group.setRotation(modelEntity.getRotation());
		group.setScale(modelEntity.getScaleX(), modelEntity.getScaleY());
		Color color = modelEntity.getColor();
		if (color != null) {
			group.setColor(color.getR(), color.getG(), color.getB(),
					color.getA());
		}
	}
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:16,代码来源:EngineEntity.java

示例4: layout

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
@Override
public void layout() {
	Group group = getLayer(Layer.SCENE_CONTENT).getGroup();
	float scaleX = getWidth() / (float) worldWidth;
	float scaleY = getHeight() / (float) worldHeight;
	float scale = Math.min(scaleX, scaleY);

	float diffX = (getWidth() - worldWidth * scale) / 2.0f;
	float diffY = (getHeight() - worldHeight * scale) / 2.0f;

	group.setPosition(diffX, diffY);
	group.setScale(scale);
	gameViewport.set(diffX, diffY, worldWidth * scale, worldHeight * scale);
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:15,代码来源:TestGameView.java

示例5: HUD

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
public HUD() {
    super();

    weaponPillTextures = new Texture[WP_OVERHEAT + 1][2];
    weaponPillTextures[WP_SELECTED][0] = new Texture("hud/hud-pill-yellow-empty.png");
    weaponPillTextures[WP_SELECTED][1] = new Texture("hud/hud-pill-yellow.png");
    weaponPillTextures[WP_UNSELECTED][0] = new Texture("hud/hud-pill-green-empty.png");
    weaponPillTextures[WP_UNSELECTED][1] = new Texture("hud/hud-pill-green.png");
    weaponPillTextures[WP_OVERHEAT][0] = new Texture("hud/hud-pill-red-empty.png");
    weaponPillTextures[WP_OVERHEAT][1] = new Texture("hud/hud-pill-red.png");

    lowerRight = new Group();
    lowerLeft = new Group();

    addActor(lowerRight);
    addActor(lowerLeft);

    // RIGHT PANEL
    Image lrPanel = new Image(new Texture("hud/hud-panel-lowerright.png"));
    lowerRight.addActor(lrPanel);
    lowerRight.setPosition(Gdx.graphics.getWidth() - lrPanel.getWidth(), 0);

    hullIcon = new Image(new Texture("hud/hud-icon-hull.png"));
    lowerRight.addActor(hullIcon);
    hullIcon.setPosition(42, 53);

    hullPills = new PillGroup(new Texture("hud/hud-pill-green-empty.png"), new Texture("hud/hud-pill-green.png"), 10, 300, (int)hullIcon.getHeight());
    lowerRight.addActor(hullPills);
    hullPills.setPosition(144, 53);

    shieldIcon = new Image(new Texture("hud/hud-icon-shield.png"));
    lowerRight.addActor(shieldIcon);
    shieldIcon.setPosition(42, 4);

    shieldPills = new PillGroup(new Texture("hud/hud-pill-blue-empty.png"), new Texture("hud/hud-pill-blue.png"), 10, 300, (int)hullIcon.getHeight());
    lowerRight.addActor(shieldPills);
    shieldPills.setPosition(144, 4);

    // LEFT PANEL
    Image llPanel = new Image(new Texture("hud/hud-panel-lowerleft.png"));
    lowerLeft.addActor(llPanel);

    laserIcon = new Image(new Texture("hud/hud-icon-laserred.png"));
    lowerLeft.addActor(laserIcon);
    laserIcon.setPosition(12, 53);

    laserPills = new PillGroup(new Texture("hud/hud-pill-green-empty.png"), new Texture("hud/hud-pill-green.png"), 10, 300, (int)hullIcon.getHeight());
    lowerLeft.addActor(laserPills);
    laserPills.setPosition(114, 53);

    missileIcon = new Image(new Texture("hud/hud-icon-missile1.png"));
    lowerLeft.addActor(missileIcon);
    missileIcon.setPosition(12, 4);

    missilePills = new PillGroup(new Texture("hud/hud-pill-green-empty.png"), new Texture("hud/hud-pill-green.png"), 10, 300, (int)hullIcon.getHeight());
    lowerLeft.addActor(missilePills);
    missilePills.setPosition(114, 4);

    selectedIcon = new Image(new Texture("hud/hud-selector-yellow.png"));
    selectedIcon.setPosition(12, 53);

    orientator = new Image(new Texture("orientator.png"));
    orientator.setPosition((Gdx.graphics.getWidth() - orientator.getWidth()) / 2, (Gdx.graphics.getHeight() - orientator.getHeight()) / 2);
    addActor(orientator);
    orientator.setColor(new Color(1, 1, 1, 0.5f));

    orient = new Image(new Texture("orientation.png"));
    orient.setPosition((Gdx.graphics.getWidth() - orient.getWidth()) / 2, (Gdx.graphics.getHeight() - orient.getHeight()) / 2);
    addActor(orient);
    orient.setColor(new Color(1, 1, 1, 0.5f));
}
 
开发者ID:fbcouch,项目名称:ahs-invaders,代码行数:72,代码来源:HUD.java


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