本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.Group类的典型用法代码示例。如果您正苦于以下问题:Java Group类的具体用法?Java Group怎么用?Java Group使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Group类属于com.badlogic.gdx.scenes.scene2d包,在下文中一共展示了Group类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldParseSpriteView
import com.badlogic.gdx.scenes.scene2d.Group; //导入依赖的package包/类
@Test
@NeedGL
public void shouldParseSpriteView() throws Exception {
CocoStudioUIEditor editor = new CocoStudioUIEditor(
Gdx.files.internal("animation/MainScene.json"), null, null, null, null);
Group group = editor.createGroup();
Image image = group.findActor("st_2");
Array<Action> actions = image.getActions();
assertThat(actions.size, is(1));
RepeatAction repeatAction = (RepeatAction) actions.get(0);
ParallelAction parallelAction = (ParallelAction) repeatAction.getAction();
assertThat(parallelAction.getActions().size, is(3));
assertThat(parallelAction.getActions(), (Matcher) everyItem(instanceOf(SequenceAction.class)));
SequenceAction moveAction = (SequenceAction) parallelAction.getActions().get(0);
SequenceAction scaleAction = (SequenceAction) parallelAction.getActions().get(1);
assertThat(moveAction.getActions().size, is(4));
assertThat(moveAction.getActions(), (Matcher) everyItem(instanceOf(MoveToAction.class)));
assertThat(scaleAction.getActions().size, is(4));
assertThat(scaleAction.getActions(), (Matcher) everyItem(instanceOf(ScaleToAction.class)));
}
示例2: 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);
}
}
示例3: getActorByName
import com.badlogic.gdx.scenes.scene2d.Group; //导入依赖的package包/类
private static Actor getActorByName(String name){
switch (name){
case "Group":
return new Group();
case "Label":
return new NativeLabel("",new NativeFont(new NativeFontPaint(14)));
case "CheckBox":
// return new CheckBox("");
case "Image":
return new Image();
case "Button":
return new Button();
case "TextField":
default:
return new Actor();
}
}
示例4: getActorType
import com.badlogic.gdx.scenes.scene2d.Group; //导入依赖的package包/类
private static Class getActorType(Actor actor){
if (actor instanceof Label){
return Label.class;
}else if (actor instanceof CheckBox){
return CheckBox.class;
}else if (actor instanceof Image){
return Image.class;
}else if (actor instanceof TextField){
return TextField.class;
}else if (actor instanceof Button){
return Button.class;
}else if (actor instanceof Group){
return Group.class;
}else {
return Actor.class;
}
}
示例5: isInsideCub
import com.badlogic.gdx.scenes.scene2d.Group; //导入依赖的package包/类
private void isInsideCub(Group group){
for (Actor child:group.getChildren()){
if (EditorManager.getInstance().getActorType(child).equals(Group.class)){
isInsideCub((Group) child);
}
if (child instanceof SelectGroup) continue;
Vector2 childVect2 = child.getParent().localToStageCoordinates(new Vector2(child.getX(),child.getY()));
childRect.set(childVect2.x,childVect2.y,child.getWidth(),child.getHeight());
if (getCullingArea().overlaps(childRect)){
if (!selection.contains(child)){
child.debug();
selection.add(child);
}
}else if (selection.contains(child)){
selection.remove(child);
child.setDebug(false);
}
}
}
示例6: getActorType
import com.badlogic.gdx.scenes.scene2d.Group; //导入依赖的package包/类
public Class getActorType(Actor actor){
if (actor instanceof Label){
return Label.class;
}else if (actor instanceof CheckBox){
return CheckBox.class;
}else if (actor instanceof Image){
return Image.class;
}else if (actor instanceof TextField){
return TextField.class;
}else if (actor instanceof Button){
return Button.class;
}else if (actor instanceof Group){
return Group.class;
}else {
return Actor.class;
}
}
示例7: getActorByName
import com.badlogic.gdx.scenes.scene2d.Group; //导入依赖的package包/类
public Actor getActorByName(String name){
switch (name){
case "Group":
return new Group();
case "Label":
return new NativeLabel("",getMainFont());
case "CheckBox":
return new VisCheckBox("");
case "Image":
return new Image(assetManager.get("badlogic.jpg",Texture.class));
case "Button":
return new VisImageButton(VisUI.getSkin().get(VisImageButton.VisImageButtonStyle.class));
case "TextField":
return new TextField("",VisUI.getSkin());
default:
return new Actor();
}
}
示例8: VRope
import com.badlogic.gdx.scenes.scene2d.Group; //导入依赖的package包/类
public VRope(GdxRopeJoint aJoint,
Group group, AtlasRegion region,
//(CCSpriteBatchNode*)spriteSheetArg
List<VPoint> points,
List<VStick> sticks,
List<Image> sprites) {
joint = aJoint;
// spriteSheet = spriteSheetArg;
this.group = group;
this.region = region;
vPoints = points;
vSticks = sticks;
ropeSprites = sprites;
numPoints = vPoints.size();
}
示例9: _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;
}
示例10: 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);
}
示例11: 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);
}
示例12: 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);
}
示例13: addTestCombat
import com.badlogic.gdx.scenes.scene2d.Group; //导入依赖的package包/类
private void addTestCombat(){
groupTestCombat = 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.15f);
groupChangeFaction.addActor(background);
Label labelFac = new Label("Combat Training",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.loadAssetsEnklaveScreen();
new GetEnklaveDetails().makeRequest(16066, manager);
gameManager.screenEnklave.setEnklave3D(new Vector2(0,0));
gameManager.setScreen(new ScreenCircleLoading(gameManager,gameManager.screenEnklave,manager.getAssertEnklaveScreen()));;
}
});
groupChangeFaction.addActor(labelFac);
}
示例14: 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);
}
示例15: 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);
}