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

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

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

Actor.setBounds介绍

[英]Set bounds the x, y, width, and height.
[中]设置x、y、宽度和高度的边界。

代码示例

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

@Override
public void layout () {
  clampSplitAmount();
  if (!vertical)
    calculateHorizBoundsAndPositions();
  else
    calculateVertBoundsAndPositions();
  Actor firstWidget = this.firstWidget;
  if (firstWidget != null) {
    Rectangle firstWidgetBounds = this.firstWidgetBounds;
    firstWidget.setBounds(firstWidgetBounds.x, firstWidgetBounds.y, firstWidgetBounds.width, firstWidgetBounds.height);
    if (firstWidget instanceof Layout) ((Layout)firstWidget).validate();
  }
  Actor secondWidget = this.secondWidget;
  if (secondWidget != null) {
    Rectangle secondWidgetBounds = this.secondWidgetBounds;
    secondWidget.setBounds(secondWidgetBounds.x, secondWidgetBounds.y, secondWidgetBounds.width, secondWidgetBounds.height);
    if (secondWidget instanceof Layout) ((Layout)secondWidget).validate();
  }
}

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

@Override
public void layout () {
  clampSplitAmount();
  if (!vertical)
    calculateHorizBoundsAndPositions();
  else
    calculateVertBoundsAndPositions();
  Actor firstWidget = this.firstWidget;
  if (firstWidget != null) {
    Rectangle firstWidgetBounds = this.firstWidgetBounds;
    firstWidget.setBounds(firstWidgetBounds.x, firstWidgetBounds.y, firstWidgetBounds.width, firstWidgetBounds.height);
    if (firstWidget instanceof Layout) ((Layout)firstWidget).validate();
  }
  Actor secondWidget = this.secondWidget;
  if (secondWidget != null) {
    Rectangle secondWidgetBounds = this.secondWidgetBounds;
    secondWidget.setBounds(secondWidgetBounds.x, secondWidgetBounds.y, secondWidgetBounds.width, secondWidgetBounds.height);
    if (secondWidget instanceof Layout) ((Layout)secondWidget).validate();
  }
}

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

c.setActorBounds(actorX, actorY, actorWidth, actorHeight);
Actor actor = c.actor;
if (actor != null) actor.setBounds(actorX, actorY, actorWidth, actorHeight);
c.setActorY(actorY);
Actor actor = c.actor;
if (actor != null) actor.setBounds(c.actorX, actorY, c.actorWidth, actorHeight);

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

c.setActorBounds(actorX, actorY, actorWidth, actorHeight);
Actor actor = c.actor;
if (actor != null) actor.setBounds(actorX, actorY, actorWidth, actorHeight);
c.setActorY(actorY);
Actor actor = c.actor;
if (actor != null) actor.setBounds(c.actorX, actorY, c.actorWidth, actorHeight);

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

public void layout () {
  if (sizeInvalid) computeSize();
  float width = getWidth(), height = getHeight();
  Array<Actor> children = getChildren();
  for (int i = 0, n = children.size; i < n; i++) {
    Actor child = children.get(i);
    child.setBounds(0, 0, width, height);
    if (child instanceof Layout) ((Layout)child).validate();
  }
}

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

public void layout () {
  if (sizeInvalid) computeSize();
  float width = getWidth(), height = getHeight();
  Array<Actor> children = getChildren();
  for (int i = 0, n = children.size; i < n; i++) {
    Actor child = children.get(i);
    child.setBounds(0, 0, width, height);
    if (child instanceof Layout) ((Layout)child).validate();
  }
}

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

actor.setBounds(x, y, width, height);
if (actor instanceof Layout) ((Layout)actor).validate();

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

actor.setBounds(x, y, width, height);
if (actor instanceof Layout) ((Layout)actor).validate();

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

child.setBounds(Math.round(x), Math.round(y), Math.round(width), Math.round(height));
else
  child.setBounds(x, y, width, height);

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

child.setBounds(Math.round(x), Math.round(y), Math.round(width), Math.round(height));
else
  child.setBounds(x, y, width, height);

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

child.setBounds(Math.round(x), Math.round(y), Math.round(width), Math.round(height));
else
  child.setBounds(x, y, width, height);
x += width + space;

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

child.setBounds(Math.round(x), Math.round(y), Math.round(width), Math.round(height));
else
  child.setBounds(x, y, width, height);
x += width + space;

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

child.setBounds(Math.round(x), Math.round(y), Math.round(width), Math.round(height));
else
  child.setBounds(x, y, width, height);
x += width + space;

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

child.setBounds(Math.round(x), Math.round(y), Math.round(width), Math.round(height));
else
  child.setBounds(x, y, width, height);
x += width + space;

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

child.setBounds(Math.round(x), Math.round(y), Math.round(width), Math.round(height));
else
  child.setBounds(x, y, width, height);

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

child.setBounds(Math.round(x), Math.round(y), Math.round(width), Math.round(height));
else
  child.setBounds(x, y, width, height);

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

shapeActor.setBounds(0, 0, 100, 150);
shapeActor.setOrigin(50, 75);
shapeActor.debug();

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

actor.setBounds(15, 15, 100, 100);
actor.setOrigin(50, 50);
stage.addActor(actor);

代码示例来源:origin: kotcrab/vis-ui

/** @param stage will contain a mock-up blocker actor, which blocks all mouse input. */
protected static void addBlocker (final Stage stage) {
  stage.addActor(BLOCKER);
  BLOCKER.setBounds(0f, 0f, stage.getWidth(), stage.getHeight());
  BLOCKER.toFront();
}

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

public void layout () {
  if (sizeInvalid) computeSize();
  float width = getWidth(), height = getHeight();
  Array<Actor> children = getChildren();
  for (int i = 0, n = children.size; i < n; i++) {
    Actor child = children.get(i);
    child.setBounds(0, 0, width, height);
    if (child instanceof Layout) ((Layout)child).validate();
  }
}

相关文章