com.badlogic.gdx.scenes.scene2d.Actor.act()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中com.badlogic.gdx.scenes.scene2d.Actor.act()方法的一些代码示例,展示了Actor.act()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Actor.act()方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.Actor
类名称:Actor
方法名:act

Actor.act介绍

[英]Updates the actor based on time. Typically this is called each frame by Stage#act(float).

The default implementation calls Action#act(float) on each action and removes actions that are complete.
[中]

代码示例

代码示例来源:origin: libgdx/libgdx

public void act (float delta) {
  super.act(delta);
  Actor[] actors = children.begin();
  for (int i = 0, n = children.size; i < n; i++)
    actors[i].act(delta);
  children.end();
}

代码示例来源:origin: libgdx/libgdx

public void act (float delta) {
  super.act(delta);
  Actor[] actors = children.begin();
  for (int i = 0, n = children.size; i < n; i++)
    actors[i].act(delta);
  children.end();
}

代码示例来源:origin: crashinvaders/gdx-texture-packer-gui

@Override
  public void run() {
    target.act(timeDelta);
  }
});

代码示例来源:origin: dingjibang/GDX-RPG

public TypedGdxQuery<T> act(float time){
  t.act(time);
  return this;
}

代码示例来源:origin: Var3D/var3dframe

public void act(float deltaTime) {
  if (!isStop) {
    super.act(deltaTime);
    stateTime += deltaTime;
  }
}

代码示例来源:origin: moribitotech/MTX

@Override
public void act(float delta) {
  super.act(delta);
}

代码示例来源:origin: stackoverflow.com

Actor some_actor = Actor.Create(Actor.Type.VOICE);
some_actor.act();

代码示例来源:origin: moribitotech/MTX

@Override
public void act(float delta) {
  super.act(delta);
  stateTime += delta;
  // Update time (1 second tick)
  // ############################################################
  if (System.nanoTime() - startTime >= 1000000000) {
    secondsTime++;
    startTime = System.nanoTime();
  }
}

代码示例来源:origin: stackoverflow.com

Actor fred = new Actor();
Actor tom = new VoiceActor();
Actor sally = new StuntActor();

fred.act();
tom.act();
sally.act();

代码示例来源:origin: com.badlogicgames.gdx/gdx

public void act (float delta) {
  super.act(delta);
  Actor[] actors = children.begin();
  for (int i = 0, n = children.size; i < n; i++)
    actors[i].act(delta);
  children.end();
}

代码示例来源:origin: dingjibang/GDX-RPG

public GdxQuery act(float time){
  for(Actor actor:list())
    actor.act(time);
  return this;
}

代码示例来源:origin: dingjibang/GDX-RPG

public TypedGdxQuery<T> stopActions(){
  while(t.hasActions())
    t.act(Gdx.graphics.getDeltaTime());
  return this;
}

代码示例来源:origin: stackoverflow.com

private Actor actionManager = new Actor(); //use a Stage instead if using one anyway
private final Color fadeColor = new Color ();
private static final Color FADED = new Color(1,1,1,0);

private void fadeOut (float duration){
  ColorAction colorAction = Actions.color(FADED, duration, Interpolation.sine);
  colorAction.setColor(fadeColor);
  actionManager.addAction(colorAction);
}

private void fadeIn (float duration){
  ColorAction colorAction = Actions.color(Color.WHITE, duration, Interpolation.sine);
  colorAction.setColor(fadeColor);
  actionManager.addAction(colorAction);
}

public void render (){
  //...

  actionManager.act(Gdx.graphics.getDeltaTime());
  batch.setColor(fadeColor);
  //...
}

代码示例来源:origin: dingjibang/GDX-RPG

public GdxQuery stopActions(){
  for(Actor t: list())
    while(t.hasActions())
      t.act(Gdx.graphics.getDeltaTime());
  return this;
}

代码示例来源:origin: dingjibang/GDX-RPG

public void act() {
  proxy.act(Gdx.graphics.getDeltaTime());
  music.setVolume(proxy.getColor().a * Game.setting.volume * Game.setting.musicVolume);
}

代码示例来源:origin: danialgoodwin/dev

@Override
public void act(float delta) {
  super.act(delta);
  if (body.getUserData() != null) {
    updateRectangle();
  } else {
    // This means the world destroyed the body (enemy or runner went out of bounds)
    remove();
  }
}

代码示例来源:origin: bladecoder/bladecoder-adventure-engine

@Override
public void act(float delta) {
  super.act(delta);
  if (getStage().getActors().get(getStage().getActors().size - 1) != this)
    toFront();
}

代码示例来源:origin: crashinvaders/gdx-texture-packer-gui

@Override
public void act(float delta) {
  super.act(delta);
  PageGroup pp = PageGroup.this;
  Vector2 pointerPos = pp.screenToLocal(Gdx.input.getX(), Gdx.input.getY());
  boolean withinPage = tmpBounds.set(0f, 0f, pp.getWidth(), pp.getHeight()).contains(pointerPos);
  if (!withinPage && active) {
    clearSpotlight();
  }
  if (withinPage) {
    RegionModel region = hitRegion(pointerPos);
    if (region != null) {
      spotlightRegion(region);
    }
    if (region == null && active) {
      clearSpotlight();
    }
  }
}

代码示例来源:origin: Catacomb-Snatch/Catacomb-Snatch

@EventHandler
public void key(KeyReleaseEvent event) {
  switch (event.getKey()) {
    case MOVE_DOWN:
      index--;
      if (index < 0) index = getActors().size - 1;
      break;
    case MOVE_UP:
      index++;
      if (index >= getActors().size) index = 0;
      break;
    case USE:
      Actor actor_u = getActors().get(index);
      if (actor_u != null) actor_u.act(Gdx.graphics.getDeltaTime());
      break;
    case BACK:
      if (!(SceneManager.getCurrent() instanceof TitleScreen)){
        SceneManager.exit();
      }
      break;
    default:
      // Nothing to do here
  }
  update(false);
}

代码示例来源:origin: stackoverflow.com

super.render();
fadeActor.act(Gdx.graphics.getDeltaTime());
float alpha = fadeActor.getColor().a;
if (alpha != 0){

相关文章