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


Java Group.getWidth方法代码示例

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


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

示例1: validate

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
public void validate () {
	if (!layoutEnabled) return;
	Group parent = getParent();
	if (fillParent && parent != null) {
		Stage stage = getStage();

		float parentWidth, parentHeight;
		if (stage != null && parent == stage.getRoot()) {
			parentWidth = stage.getWidth();
			parentHeight = stage.getHeight();
		} else {
			parentWidth = parent.getWidth();
			parentHeight = parent.getHeight();
		}
		if (getWidth() != parentWidth || getHeight() != parentHeight) {
			setWidth(parentWidth);
			setHeight(parentHeight);
			invalidate();
		}
	}

	if (!needsLayout) return;
	needsLayout = false;
	layout();
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:26,代码来源:WidgetGroup.java

示例2: validate

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
public void validate () {
	if (!layoutEnabled) return;

	Group parent = getParent();
	if (fillParent && parent != null) {
		float parentWidth, parentHeight;
		Stage stage = getStage();
		if (stage != null && parent == stage.getRoot()) {
			parentWidth = stage.getWidth();
			parentHeight = stage.getHeight();
		} else {
			parentWidth = parent.getWidth();
			parentHeight = parent.getHeight();
		}
		setSize(parentWidth, parentHeight);
	}

	if (!needsLayout) return;
	needsLayout = false;
	layout();
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:22,代码来源:Widget.java

示例3: perform

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
@Override
public void perform(Object... args) {
	toast.setText((String) args[0]);

	boolean showUndo = args.length == 2 && ((Float) args[1]) > 0;
	float toastTime = (showUndo ? (Float) args[1] : DEFAULT_TOAST_TIME) - 2.0f;

	undo.setVisible(showUndo);

	toast.pack();
	Group modalsContainer = controller.getViews().getModalsContainer();
	float x = modalsContainer.getWidth() / 2.0f - toast.getWidth() / 2.0f;
	float y = modalsContainer.getHeight() / 10.0f;
	toast.setPosition(x, y);
	toast.clearActions();
	toast.addAction(Actions.sequence(Actions.alpha(0.0f),
			Actions.alpha(1.0f, 1.0f, Interpolation.exp5Out),
			Actions.delay(toastTime),
			Actions.alpha(0.0f, 1.0f, Interpolation.exp5Out),
			Actions.removeActor()));
	controller.getViews().addToModalsContainer(toast);
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:23,代码来源:ShowToast.java

示例4: getPrefWidth

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
public float getPrefWidth()
{
  float f1 = Gdx.graphics.getWidth();
  Group localGroup = getParent();
  Table localTable;
  if ((localGroup instanceof Table))
  {
    localTable = (Table)localGroup;
    if (localTable.getPadLeft() == null)
      break label153;
  }
  label153: for (float f3 = localTable.getPadLeft().a(localTable.getCell(this)); ; f3 = 0.0F)
  {
    e locale = localTable.getPadRight();
    float f4 = 0.0F;
    if (locale != null)
      f4 = localTable.getPadRight().a(localTable.getCell(this));
    f1 = localGroup.getWidth() - f3 - f4;
    float f2 = this.s + 2.0F * this.s * this.h * this.g * this.i;
    if (this.f.background != null)
      f2 += this.f.background.getTotalWidth();
    return Math.min(f1, f2);
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:25,代码来源:WidgetCarousel.java

示例5: validate

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
public void validate()
{
  if (!this.layoutEnabled)
    return;
  Group localGroup = getParent();
  Stage localStage;
  float f1;
  if ((this.fillParent) && (localGroup != null))
  {
    localStage = getStage();
    if ((localStage == null) || (localGroup != localStage.getRoot()))
      break label103;
    f1 = localStage.getWidth();
  }
  for (float f2 = localStage.getHeight(); ; f2 = localGroup.getHeight())
  {
    if ((getWidth() != f1) || (getHeight() != f2))
    {
      setWidth(f1);
      setHeight(f2);
      invalidate();
    }
    if (!this.needsLayout)
      break;
    layout();
    this.needsLayout = false;
    return;
    label103: f1 = localGroup.getWidth();
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:31,代码来源:WidgetGroup.java

示例6: validate

import com.badlogic.gdx.scenes.scene2d.Group; //导入方法依赖的package包/类
public void validate()
{
  if (!this.layoutEnabled)
    return;
  Group localGroup = getParent();
  Stage localStage;
  float f1;
  if ((this.fillParent) && (localGroup != null))
  {
    localStage = getStage();
    if ((localStage == null) || (localGroup != localStage.getRoot()))
      break label103;
    f1 = localStage.getWidth();
  }
  for (float f2 = localStage.getHeight(); ; f2 = localGroup.getHeight())
  {
    if ((getWidth() != f1) || (getHeight() != f2))
    {
      setWidth(f1);
      setHeight(f2);
      invalidate();
    }
    if (!this.needsLayout)
      break;
    this.needsLayout = false;
    layout();
    return;
    label103: f1 = localGroup.getWidth();
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:31,代码来源:Widget.java


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