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


Java Group.addActor方法代码示例

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


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

示例1: readAttr

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private static void readAttr(Group parentGroup, XmlReader.Element element){
    if (element.getName().equals("Stage")){
        XmlUtils.parseGenAttr(parentGroup,element);
        if (element.getChildCount()>0){
            for (int i = 0;i<element.getChildCount();i++){
                readAttr(parentGroup,element.getChild(i));
            }
        }
    }else if (element.getName().equals("Group")){
        Group group = new Group();
        XmlUtils.parseGenAttr(group,element);
        parentGroup.addActor(group);
        if (element.getChildCount()>0){
            for (int i = 0;i<element.getChildCount();i++){
                readAttr(group,element.getChild(i));
            }
        }
    }else {
        Actor actor = getActorByName(element.getName());
        parentGroup.addActor(actor);
        XmlUtils.parseGenAttr(actor,element);
        XmlUtils.parseUqAttr(actor,element);
    }

}
 
开发者ID:whitecostume,项目名称:libgdx_ui_editor,代码行数:26,代码来源:XmlUtils.java

示例2: _init

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
public void _init(Drawable[] textures, int depth, Vector2[] bias) {
	if (bias != null && bias.length != textures.length)
		throw new IllegalArgumentException();
	group = new Group();
	images = new Image[textures.length];
	for (int i=0; i<textures.length; i++) {
		Drawable texture = textures[i];
		Image image = new Image(texture);
		images[i] = image;
		image.setBounds(0, 0, texture.getMinWidth(), texture.getMinHeight());
		if (bias != null)
			image.setPosition(bias[i].x, bias[i].y, Align.center);
		else
			image.setPosition(0, 0, Align.center);
		group.addActor(image);
	}
	mDepth = depth;
	biases = bias;
}
 
开发者ID:cn-s3bit,项目名称:TH902,代码行数:20,代码来源:ImageGroupRenderer.java

示例3: createCarouselExtension

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void createCarouselExtension() {
    lookup = manager.getAssetsExtension().getTexture(NameFiles.progressbarcircular);
    lookup.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
    groupCarousel = new Group();
    arrayGroup = new Group[4];
    arrayGroup[2] = addoneExtension("GAMMA SHIELD", NameFiles.imageExtensionGammaShield,9,8,5,7,23);
    arrayGroup[2].setScale(0.8f);
    arrayGroup[2].setPosition(Gdx.graphics.getWidth() * 0.1f, 0);
    groupCarousel.addActor(arrayGroup[2]);
    arrayGroup[3] = addoneExtension("SHIELD",NameFiles.imageExtensionRegularShield,7.5,8,4,6,23);
    arrayGroup[3].setScale(0.8f);
    arrayGroup[3].setPosition(Gdx.graphics.getWidth() * 0.1f, Gdx.graphics.getHeight() * 0.28f);
    groupCarousel.addActor(arrayGroup[3]);
    arrayGroup[1] = addoneExtension("AUTO TURRET", NameFiles.imageExtensionAutoTurret,9,5,7,3,8);
    arrayGroup[1].setScale(0.8f);
    arrayGroup[1].setPosition(Gdx.graphics.getWidth() * 0.1f, -Gdx.graphics.getHeight() * 0.1f);
    groupCarousel.addActor(arrayGroup[1]);
    arrayGroup[0] = addoneExtension("REMOTE TURRET", NameFiles.imageExtensionRemoteTurret, 5, 2, 8.5, 7,45);
    groupCarousel.addActor(arrayGroup[0]);
    groupCarousel.setVisible(false);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:22,代码来源:ScreenExtensions.java

示例4: addBackgroundExtension

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void addBackgroundExtension() {
    Image stobottom = new Image(new TextureRegion(manager.getAssetsExtension().getTexture(NameFiles.imageArrowBottom)));
    stobottom.setSize(Gdx.graphics.getWidth() * 0.1f, Gdx.graphics.getWidth() * 0.22f);
    stobottom.setPosition(Gdx.graphics.getWidth() / 2 - stobottom.getWidth() / 2, Gdx.graphics.getHeight() * 0.74f);
    Image selectroomtext = new Image(new TextureRegion(manager.getAssetsExtension().getTexture(NameFiles.txtSelectExtension)));
    selectroomtext.setSize(Gdx.graphics.getWidth() * 0.44f, Gdx.graphics.getHeight() * 0.12f);
    selectroomtext.setPosition(Gdx.graphics.getWidth() / 2 - selectroomtext.getWidth() / 2, Gdx.graphics.getHeight() * 0.815f);
    RepeatAction repeatActioan = new RepeatAction();
    MoveToAction fadedown = new MoveToAction();
    fadedown.setPosition(Gdx.graphics.getWidth() / 2 - stobottom.getWidth() / 2, Gdx.graphics.getHeight() * 0.71f);
    fadedown.setDuration(0.5f);
    MoveToAction fadeup = new MoveToAction();
    fadeup.setPosition(Gdx.graphics.getWidth() / 2 - stobottom.getWidth() / 2, Gdx.graphics.getHeight() * 0.74f);
    fadeup.setDuration(1f);
    repeatActioan.setAction(new SequenceAction(fadedown, fadeup));
    repeatActioan.setCount(RepeatAction.FOREVER);
    stobottom.addAction(repeatActioan);
    groupBtn = new Group();
    groupBtn.addActor(stobottom);
    groupBtn.addActor(selectroomtext);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:22,代码来源:ScreenExtensions.java

示例5: addChangeFaction

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void addChangeFaction(){
    groupChangeFaction = new Group();
    Image background = new Image(new TextureRegion(manager.getAssetsSettings().getTexture(NameFiles.extensionImgBackground)));
    background.setSize(Width - Width * 0.03f, Height * 0.1f);
    background.setPosition(Width / 2 - background.getWidth() / 2, Height * 0.3f);
    groupChangeFaction.addActor(background);
    Label labelFac = new Label("Change Faction",new Label.LabelStyle(Font.getFont((int)(Height*0.025f)),Color.WHITE));
    labelFac.setPosition(background.getX()+background.getWidth()*0.05f,background.getY()+background.getHeight()/2-labelFac.getHeight()/2);
    labelFac.addListener(new ClickListener(){
        @Override
        public void clicked(InputEvent event, float x, float y) {
            manager.loadAssetsChoiceFaction();
            gameManager.setScreen(new ScreenCircleLoading(gameManager,new ScreenChoiceFaction(gameManager),manager.getAssetsChoiceFaction()));
        }
    });
    groupChangeFaction.addActor(labelFac);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:18,代码来源:ScreenSetting.java

示例6: drawtopcombat

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void drawtopcombat(){
    groupTop = new Group();
    Texture lookup = managerAssets.getAssetsCombat().getTexture(NameFiles.progressbarcircular);
    lookup.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
    progressBarEnergy = ProgressBarEnergy.getInstance();
    Image imageLeftprofile = new Image(new TextureRegion(managerAssets.getAssetsButton().get(NameFiles.buttonBack1)));
    imageLeftprofile.setSize(Gdx.graphics.getWidth() * 0.15f, Gdx.graphics.getWidth() * 0.15f);
    imageLeftprofile.setPosition(imageLeftprofile.getWidth() * 0.1f, Gdx.graphics.getHeight() - imageLeftprofile.getHeight() * 1.1f);
    imageLeftprofile.addListener(new ClickListener(){
        @Override
        public void clicked(InputEvent event, float x, float y) {
            if(InformationProfile.getInstance().getDateUserGame().getEnklaveCombatId() == -1)
                gameManager.setScreen(gameManager.screenEnklave);
            else
                dialogExit("You can't out from combat!");
        }
    });
    groupTop.addActor(imageLeftprofile);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:20,代码来源:ScreenCombat.java

示例7: drawdefenders

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void drawdefenders(){
    defenders = new DrawDefenders();
    groupBtnDefender = new Group();
    Button btn1 = new Button(new ImageButton.ImageButtonStyle());
    btn1.setName("btn1");
    btn1.setSize(Gdx.graphics.getWidth() * 0.18f, Gdx.graphics.getWidth() * 0.2f);
    btn1.setPosition(Gdx.graphics.getWidth() * 0.025f, Gdx.graphics.getHeight() / 2.3f - Gdx.graphics.getHeight() * 0.14f);
    groupBtnDefender.addActor(btn1);
    Button btn2 = new Button(new ImageButton.ImageButtonStyle());
    btn2.setName("btn2");
    btn2.setSize(Gdx.graphics.getWidth() * 0.18f, Gdx.graphics.getWidth() * 0.2f);
    btn2.setPosition(Gdx.graphics.getWidth() * 0.025f, Gdx.graphics.getHeight() / 2.3f);
    groupBtnDefender.addActor(btn2);
    Button btn3 = new Button(new ImageButton.ImageButtonStyle());
    btn3.setName("btn3");
    btn3.setSize(Gdx.graphics.getWidth() * 0.18f, Gdx.graphics.getWidth() * 0.2f);
    btn3.setPosition(Gdx.graphics.getWidth() * 0.025f, Gdx.graphics.getHeight() / 2.3f + Gdx.graphics.getHeight() * 0.14f);
    groupBtnDefender.addActor(btn3);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:20,代码来源:ScreenCombat.java

示例8: build

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
@Override
public void build(Group group) {
	pauseButtonTexture = new TextureRegionDrawable(new TextureRegion(new Texture("pause.png")));
	backButtonTexture = new TextureRegionDrawable(new TextureRegion(new Texture("back.png")));
	
	pauseButton = new VisImageButton(pauseButtonTexture);
	pauseButton.addListener(new ChangeListener() {
		@Override
		public void changed(ChangeEvent event, Actor actor) {
			((WorldSimulator)getController()).toggleOverlayMenu();
		}
	});
	
	pauseButton.setWidth(widthVal.get(pauseButton));
	pauseButton.setHeight(heightVal.get(pauseButton));
	
	group.addActor(pauseButton);
}
 
开发者ID:mcgeer,项目名称:Climatar,代码行数:19,代码来源:PauseView.java

示例9: 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

示例10: add

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
void add(GameWindow window) {
    if (windows.contains(window, true))
        return;
    Group parent;
    if (window.getTargetParent() != null) {
        if (window.getTargetParent().getStage() == null)
            throw new IllegalStateException("no stage in target parent to show window!");
        parent = window.getTargetParent();
    } else {
        if (activeStage == null)
            throw new IllegalStateException("no active stage to show window!");
        parent = activeStage.getRoot();
    }
    windows.add(window);
    parent.addActor(window);
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:17,代码来源:WindowManager.java

示例11: createListener

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private ClickListener createListener(final Group group, final Image selection, final LocLabel label, final CreatureEffect effect, final Creature creature) {
    return new ClickListener() {
        @Override public void clicked(InputEvent event, float x, float y) {
            group.addActor(selection);
            final int turnCount = effect.getTurnCount();
            if (turnCount > 1000) {
                //forever effect
                label.setKey("ui-creature-info-window-forever-effect-description");
                label.setParams(Thesaurus.params()
                        .with("desc", effect.locDescKey())
                        .with("die", creature.description.nameLocKey())
                );
            } else {
                label.setKey("ui-creature-info-window-effect-description");
                label.setParams(Thesaurus.params()
                        .with("desc", effect.locDescKey())
                        .with("turn-count", String.valueOf(turnCount))
                        .with("die", creature.description.nameLocKey())
                );
            }
        }
    };
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:24,代码来源:CreatureInfoWindow.java

示例12: AbstractMenuScreen

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
public <E extends Enum<?>> AbstractMenuScreen(Class<E> menuEnumClass, BitmapFont pFont, Class<?> selectorClass) {

		stage = new Stage();
		Gdx.input.setInputProcessor(stage);
		font = pFont != null ? pFont : new BitmapFont();
		font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);		
		font.setColor(0, 0, 0, 1);
		selectorHeight = font.getCapHeight();
		initItemsPositions(menuEnumClass);
		generateSelector(selectorClass);
		foregroundGroup= new Group();
		backgroundGroup = new Group();
		addBackgroundElements();
		foregroundGroup.addActor(selector);
		stage.addActor(backgroundGroup);
		stage.addActor(foregroundGroup);		
	}
 
开发者ID:provenza24,项目名称:Mario-Libgdx,代码行数:18,代码来源:AbstractMenuScreen.java

示例13: Board

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
/**
 * Holds board information
 * 
 * @param width
 *            Column number of the board
 * @param height
 *            Row number of the board
 * @param fg
 *            Reference to foreground
 * @param camera
 *            Camera of the stage
 */
public Board(int width, int height, Group fg, Camera camera)
{
    this.boardCols = width;
    this.boardRows = height;
    setOrigin(1, 1);

    /* Add range group to fg first */
    rangeGroup = new Group();
    fg.addActor(rangeGroup);

    /* Add block group to fg */
    blockGroup = new Group();
    fg.addActor(blockGroup);

    loadMap(camera, "t1.tmx");
    createBoard();
    blockPools = new BlockPools(this);
    neighbours = new Array<Tile>();
    turn = Turn.FIRE;
}
 
开发者ID:mfkaptan,项目名称:freeze-fire-tag,代码行数:33,代码来源:Board.java

示例14: create

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
@Override
protected Actor create(Skin skin, StageLayoutListener listener) {
	Group group = (Group)super.create(skin, listener);

	for(int i=0; i<actors.size; i++){
		ActorLayout layout = actors.get(i);

		group.addActor(layout.create(skin, listener));
	}

	if(sizeToActor != null){
		Actor actor = group.findActor(sizeToActor);
		if(actor != null){
			group.setWidth(actor.getWidth());
			group.setHeight(actor.getHeight());
		}
	}
	else {
		if(layout.width > 0)
			group.setWidth(layout.width);
		if(layout.height > 0)
			group.setHeight(layout.height);
	}

	return group;
}
 
开发者ID:code-disaster,项目名称:libgdx-snippets,代码行数:27,代码来源:GroupLayout.java

示例15: initBackground

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
/**
 * initBackground.
 */
private void initBackground() {
	backgroundGraphics = new Group();

	TextureRegion tree = AssetManager.getTextureRegion("appleRun", "tree");
	TextureRegion ground = AssetManager.getTextureRegion("appleRun", "ground");

	Image treeImage = new Image(tree);
	treeImage.setY(144);
	timeBar = new TimeBar();
	timeBar.setX(32);
	timeBar.setY(32);

	backgroundGraphics.addActor(treeImage);
	backgroundGraphics.addActor(new Image(ground));

	backgroundGraphics.addActor(timeBar);
}
 
开发者ID:PhilippGrulich,项目名称:HAW-SE2-projecthorse,代码行数:21,代码来源:Gamestate.java


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