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


Java Group.addAction方法代码示例

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


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

示例1: move3

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void move3(Group gr, float procent, float time) {
    MoveToAction move = new MoveToAction();
    move.setDuration(time);
    if(time==0) {
        move.setPosition(0, -procent * distanceReference);
    }else {
        if(Math.abs(procent)<=0.5) {
            move.setPosition(0, 0);
        }else if(procent>0.5){
            move.setPosition(p2.x,p2.y);
        }else{
            move.setPosition(p4.x,p4.y);
        }
    }
    gr.addAction(move);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:17,代码来源:DrawAttachers.java

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

示例3: move0

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void move0(Group gr, float procent, float time) {
    MoveToAction move = new MoveToAction();
    move.setDuration(time);
    ScaleToAction scale = new ScaleToAction();
    scale.setDuration(time);
    if(time == 0) {
        gr.clearActions();
        gr.clearActions();
        if (procent < 0) {
            scale.setScale(0.5f + (Math.abs(procent) * 0.3f));
            move.setPosition(p0.x + procent * d01.x, p0.y + (1 - (procent * d01.y)));
            addfirst();
        }else{
            scale.setScale(0.5f);
            move.setPosition(p0.x,p0.y);
        }
    }else{
        if(Math.abs(procent)<=0.5){
            scale.setScale(0.5f);
            move.setPosition(p0.x,p0.y);
        }else if(procent < -0.5) {
            scale.setScale(0.8f);
            move.setPosition(p1.x, p1.y);
            addfirst();
        }else{
            scale.setScale(0.5f);
            move.setPosition(p0.x,p0.y);
        }
    }
    gr.addAction(scale);
    gr.addAction(move);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:33,代码来源:DrawAttachers.java

示例4: move1

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void move1(Group gr, float procent, float time) {
    MoveToAction move = new MoveToAction();
    move.setDuration(time);
    ScaleToAction scale = new ScaleToAction();
    scale.setDuration(time);
    if(time == 0) {
        gr.clearActions();
        gr.clearActions();
        if (procent > 0) {
            scale.setScale(0.8f - (Math.abs(procent) * 0.3f));
            move.setPosition(p1.x + (procent * d01.x), p1.y + (1 - (procent * d01.y)));
        } else {
            scale.setScale(0.8f + (Math.abs(procent) * 0.2f));
            move.setPosition(p1.x + (procent * d12.x), p1.y + (1 - (procent * d12.y)));
        }
    }else{
        if(Math.abs(procent)<=0.5){
            scale.setScale(0.8f);
            move.setPosition(p1.x,p1.y);
        }else if(procent > 0.5){
            scale.setScale(0.5f);
            move.setPosition(p0.x, p0.y);
        }else{
            scale.setScale(1);
            move.setPosition(p2.x,p2.y);
        }
    }
    gr.addAction(scale);
    gr.addAction(move);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:31,代码来源:DrawAttachers.java

示例5: move2

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void move2(Group gr, float procent, float time) {
    MoveToAction move = new MoveToAction();
    move.setDuration(time);
    ScaleToAction scale = new ScaleToAction();
    scale.setDuration(time);
    if(time == 0) {
        if (procent > 0) {
            scale.setScale(1 - (Math.abs(procent) * 0.2f));
            move.setPosition(p2.x + procent * d12.x, p2.y + (1 - (procent * d12.y)));
        } else {
            scale.setScale(1);
            move.setPosition(0, p2.y - procent * distanceReference);
        }
    }else{
        if(Math.abs(procent)<=0.5){
            scale.setScale(1);
            move.setPosition(p2.x,p2.y);
        }else if(procent>0.5){
            scale.setScale(0.8f);
            move.setPosition(p1.x,p1.y);
        }else{
            scale.setScale(1);
            move.setPosition(0,0);
        }
    }
    gr.addAction(scale);
    gr.addAction(move);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:29,代码来源:DrawAttachers.java

示例6: move4

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void move4(Group gr, float procent, float time) {
    MoveToAction move = new MoveToAction();
    move.setDuration(time);
    ScaleToAction scale = new ScaleToAction();
    scale.setDuration(time);
    if (time ==0) {
        if (procent > 0) {
            scale.setScale(1);
            move.setPosition(0, p4.y - procent * distanceReference);
        } else {
            scale.setScale(1 - (Math.abs(procent) * 0.2f));
            move.setPosition(p4.x - procent * d45.x, p4.y + (1 - (procent * d45.y)));
        }
    }else{
        if(Math.abs(procent)<=0.5){
            scale.setScale(1);
            move.setPosition(p4.x,p4.y);
        }else if(procent>=0.5){
            scale.setScale(1);
            move.setPosition(0,0);
        }else{
            scale.setScale(0.8f);
            move.setPosition(p5.x,p5.y);
        }
    }
    gr.addAction(scale);
    gr.addAction(move);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:29,代码来源:DrawAttachers.java

示例7: move5

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void move5(Group gr, float procent, float time) {
    MoveToAction move = new MoveToAction();
    move.setDuration(time);
    ScaleToAction scale = new ScaleToAction();
    scale.setDuration(time);
    if(time == 0) {
        gr.clearActions();
        gr.clearActions();
        if (procent > 0) {
            scale.setScale(0.8f + (Math.abs(procent) * 0.2f));
            move.setPosition(p5.x - (procent * d45.x), p5.y + (1 - (procent * d45.y)));
        } else {
            scale.setScale(0.8f - (Math.abs(procent) * 0.3f));
            move.setPosition(p5.x - (procent * d56.x),p5.y + (1-(procent*d56.y)));
        }
    }else{
        if(Math.abs(procent)<=0.5){
            scale.setScale(0.8f);
            move.setPosition(p5.x,p5.y);
        }else if(procent > 0.5){
            scale.setScale(1);
            move.setPosition(p4.x, p4.y);
        }else{
            scale.setScale(0.5f);
            move.setPosition(p6.x,p6.y);
        }
    }
    gr.addAction(scale);
    gr.addAction(move);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:31,代码来源:DrawAttachers.java

示例8: move6

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
private void move6(Group gr, float procent, float time) {
    MoveToAction move = new MoveToAction();
    move.setDuration(time);
    ScaleToAction scale = new ScaleToAction();
    scale.setDuration(time);
    if(time == 0) {
        gr.clearActions();
        gr.clearActions();
        if (procent > 0) {
            scale.setScale(0.5f + (Math.abs(procent) * 0.3f));
            move.setPosition(p6.x - procent * d56.x, p6.y + (1 - (procent * d56.y)));
            addlast();
        }else{
            scale.setScale(0.5f);
            move.setPosition(p6.x,p6.y);
        }
    }else{
        if(Math.abs(procent)<=0.5){
            scale.setScale(0.5f);
            move.setPosition(p6.x,p6.y);
        }else if(procent > 0.5) {
            scale.setScale(0.8f);
            move.setPosition(p5.x, p5.y);
            addlast();
        }else{
            scale.setScale(0.5f);
            move.setPosition(p6.x,p6.y);
        }
    }
    gr.addAction(scale);
    gr.addAction(move);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:33,代码来源:DrawAttachers.java

示例9: onChangedState

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
@Override public void onChangedState(Boolean active) {
    Group appearing = active ? onGroup : offGroup;
    Group disappearing = active ? offGroup : onGroup;
    appearing.clearActions();
    appearing.addAction(alpha(1, 0.5f));
    disappearing.clearActions();
    disappearing.addAction(alpha(0, 0.5f));
    if (active) {
        SoundManager.instance.playMusicAsSound("step-detector-activation");
    }
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:12,代码来源:StepDetectorSubView.java

示例10: process

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
@Override public IFuture<Response> process(final Params params) {
    final Future<Response> future = new Future<Response>();
    Stage stage = ((DiceHeroes) Gdx.app.getApplicationListener()).getState().stage;
    Tile icon = new Tile("ui/pvp/timer");
    icon.setPosition(ICON_PADDING, ICON_PADDING);

    Tile progress = new Tile("ui-reward-window-background");
    progress.setTouchable(Touchable.disabled);
    progress.setPosition(
        ICON_PADDING * 2 + icon.getWidth(),
        ICON_PADDING + icon.getHeight() * 0.5f - BAR_HEIGHT * 0.5f
    );
    progress.setSize(
        stage.getWidth() - ICON_PADDING * 3 - icon.getWidth(),
        BAR_HEIGHT
    );
    root = new Group();
    root.addActor(progress);
    root.addActor(icon);

    stage.addActor(root);
    root.addAction(delay(25, forever(sequence(
        visible(false),
        delay(0.1f),
        visible(true),
        delay(0.4f)
    ))));
    progress.addAction(
        sequence(
            sizeTo(0, BAR_HEIGHT, 30f),
            run(new Runnable() {
                @Override public void run() {
                    root.remove();
                    skip(future, params);
                }
            })
        )
    );
    processor.process(params).addListener(future);
    return future.addListener(this);
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:42,代码来源:PvpUserWrapper.java

示例11: a

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
protected final Table a(Skin paramSkin, Stage paramStage, int paramInt)
{
  this.w = paramSkin;
  this.x = ((Label.LabelStyle)paramSkin.get("portal-stats", Label.LabelStyle.class));
  this.D = new Image(paramSkin.getRegion("portal_key"));
  this.E = new Image(paramSkin.getRegion("portal_key_ghosted"));
  a(null);
  ScrollLabel.ScrollLabelStyle localScrollLabelStyle = new ScrollLabel.ScrollLabelStyle(paramSkin.getFont("default-font"), Color.WHITE, 20.0F, 28, true);
  Table localTable1 = new Table();
  localTable1.defaults().f(ag).h(af);
  localTable1.add(d()).n().f().i().j();
  localTable1.row();
  this.F = new Table();
  this.F.setBackground(this.w.getDrawable("default-window-no-outline"));
  this.V = new ActionButton("LINK", null, (ActionButton.ActionButtonStyle)this.w.get("default-slim", ActionButton.ActionButtonStyle.class));
  this.V.a(new as(this));
  b(0.0F);
  this.W = new Image();
  this.W.addAction(Actions.alpha(0.0F));
  localTable1.add(this.F).g().l().e(ag);
  Table localTable2 = new Table();
  localTable2.defaults().d(af);
  localTable2.add(i()).k().n().g().j();
  localTable2.row();
  localTable2.add(m()).n().f().e(ag).b(com.a.a.e.b(0.7F)).g(ag).l();
  Table localTable3 = new Table();
  Table localTable4 = new Table();
  this.L = new g(null, localScrollLabelStyle, 8);
  this.M = new Label("", (Label.LabelStyle)paramSkin.get("large", Label.LabelStyle.class));
  localTable4.add(this.L).o().g().k();
  localTable4.add(this.M).m().f(af);
  localTable4.setBackground(paramSkin.getDrawable("portal-info-dialog-title-bg"));
  localTable3.add(localTable4).o().g().f(af).k().b(Integer.valueOf(2)).f((int)(paramStage.getWidth() - 40.0F));
  localTable3.row();
  localTable3.add(localTable1).n().f().a(com.a.a.e.a(0.57F));
  localTable3.add(localTable2).n().f().a(com.a.a.e.a(0.43F));
  localTable3.top();
  this.q = new SelectableHudFragment(this.h);
  a(this.q.b());
  this.g.a(this.j, this.q);
  float f1 = this.o;
  Group localGroup = new Group();
  localGroup.addAction(Actions.delay(f1, Actions.run(new ap(this, localGroup))));
  paramStage.addActor(localGroup);
  a(this.u);
  this.aG = false;
  this.k.a(this.p);
  p();
  com.nianticproject.ingress.gameentity.f localf = this.r.getEntity();
  ImageByBytes localImageByBytes = (ImageByBytes)localf.getComponent(ImageByBytes.class);
  if (localImageByBytes != null)
  {
    byte[] arrayOfByte = localImageByBytes.getImageBytes();
    Pixmap localPixmap = new Pixmap(arrayOfByte, 0, arrayOfByte.length);
    TextureRegion localTextureRegion = new TextureRegion(new Texture(localPixmap));
    localPixmap.dispose();
    this.C = new aq(this, localTextureRegion);
    return localTable3;
  }
  String str = com.nianticproject.ingress.gameentity.components.f.a(localf, "");
  this.C = this.e.a(str, (int)Math.max(localTable3.getPrefWidth(), localTable3.getPrefHeight()));
  if ("".equals(str))
  {
    this.A.setVisible(true);
    return localTable3;
  }
  this.A.setVisible(false);
  return localTable3;
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:70,代码来源:PortalInfoDialog.java


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