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

x33g5p2x  于2022-01-20 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(127)

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

Group.isVisible介绍

暂无

代码示例

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

public Actor hit (float x, float y, boolean touchable) {
  if (touchable && getTouchable() == Touchable.disabled) return null;
  if (!isVisible()) return null;
  Vector2 point = tmp;
  Actor[] childrenArray = children.items;
  for (int i = children.size - 1; i >= 0; i--) {
    Actor child = childrenArray[i];
    child.parentToLocalCoordinates(point.set(x, y));
    Actor hit = child.hit(point.x, point.y, touchable);
    if (hit != null) return hit;
  }
  return super.hit(x, y, touchable);
}

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

public Actor hit (float x, float y, boolean touchable) {
  if (touchable && getTouchable() == Touchable.disabled) return null;
  if (!isVisible()) return null;
  Vector2 point = tmp;
  Actor[] childrenArray = children.items;
  for (int i = children.size - 1; i >= 0; i--) {
    Actor child = childrenArray[i];
    child.parentToLocalCoordinates(point.set(x, y));
    Actor hit = child.hit(point.x, point.y, touchable);
    if (hit != null) return hit;
  }
  return super.hit(x, y, touchable);
}

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

public void draw () {
  Camera camera = viewport.getCamera();
  camera.update();
  if (!root.isVisible()) return;
  Batch batch = this.batch;
  batch.setProjectionMatrix(camera.combined);
  batch.begin();
  root.draw(batch, 1);
  batch.end();
  if (debug) drawDebug();
}

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

public void draw () {
  Camera camera = viewport.getCamera();
  camera.update();
  if (!root.isVisible()) return;
  Batch batch = this.batch;
  batch.setProjectionMatrix(camera.combined);
  batch.begin();
  root.draw(batch, 1);
  batch.end();
  if (debug) drawDebug();
}

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

public Actor hit (float x, float y, boolean touchable) {
  if (touchable && getTouchable() == Touchable.disabled) return null;
  if (!isVisible()) return null;
  Vector2 point = tmp;
  Actor[] childrenArray = children.items;
  for (int i = children.size - 1; i >= 0; i--) {
    Actor child = childrenArray[i];
    child.parentToLocalCoordinates(point.set(x, y));
    Actor hit = child.hit(point.x, point.y, touchable);
    if (hit != null) return hit;
  }
  return super.hit(x, y, touchable);
}

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

public void draw () {
  Camera camera = viewport.getCamera();
  camera.update();
  if (!root.isVisible()) return;
  Batch batch = this.batch;
  batch.setProjectionMatrix(camera.combined);
  batch.begin();
  root.draw(batch, 1);
  batch.end();
  if (debug) drawDebug();
}

代码示例来源:origin: lycying/c2d-engine

@Override
  public void draw() {
    if (!getRoot().isVisible()) return;
    Engine.getSpriteBatch().begin();
    getRoot().draw(Engine.getSpriteBatch(), 1);
    Engine.getSpriteBatch().end();
  }
}

代码示例来源:origin: org.mini2Dx/mini2Dx-core

@Override
public void drawStage(Stage stage) {
  endRendering();
  
  Camera stageCamera = stage.getViewport().getCamera();
  stageCamera.up.set(0, -1, 0);
  stageCamera.direction.set(0, 0, 1);
  stageCamera.update();
  if (!stage.getRoot().isVisible()) {
    return;
  }
  renderingStage = true;
  beginRendering();
  
  spriteBatch.setProjectionMatrix(stageCamera.combined);
  polygonSpriteBatch.setProjectionMatrix(stageCamera.combined);
  shapeRenderer.setProjectionMatrix(stageCamera.combined);
  
  spriteBatch.begin();
  stage.getRoot().draw(spriteBatch, 1);
  spriteBatch.end();
  
  endRendering();
  renderingStage = false;
}

代码示例来源:origin: peakgames/libgdx-stagebuilder

private void updateGroupProperties( ExternalGroupModel model, Group group){
    group.setName( model.getName());
    model.setWidth( group.getWidth());
    model.setHeight( group.getHeight());
    
    // For example .. <FriendsPanel > in top xml and its implementation's root group (FriendsPanel.xml file's) 
    // should both be visible=true in order to set whole group visible, if at least one of them set to false 
    // whole group will be invisible.
    group.setVisible(model.isVisible() && group.isVisible());
    
    Vector2 screenPos;
    if (model.getScreenAlignmentSupport() == null) {
      screenPos = calculateScreenPosition(model.getScreenAlignment(), model);
    } else {
      screenPos = calculateScreenPosition(model.getScreenAlignment(), model.getScreenAlignmentSupport(), model);
    }

    if (screenPos != null) {
      group.setPosition(screenPos.x, screenPos.y);
    } else {
      float positionMultiplier = resolutionHelper.getPositionMultiplier();
      group.setPosition(model.getX() * positionMultiplier, model.getY() * positionMultiplier);
    }

    setScaleProperty(model, group);
  }
}

相关文章

微信公众号

最新文章

更多