當前位置: 首頁>>代碼示例>>Java>>正文


Java Align.center方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.scenes.scene2d.utils.Align.center方法的典型用法代碼示例。如果您正苦於以下問題:Java Align.center方法的具體用法?Java Align.center怎麽用?Java Align.center使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.scenes.scene2d.utils.Align的用法示例。


在下文中一共展示了Align.center方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: reset

import com.badlogic.gdx.scenes.scene2d.utils.Align; //導入方法依賴的package包/類
/** Removes all actors and cells from the table (same as {@link #clear()}) and additionally resets all table properties and
 * cell, column, and row defaults. */
public void reset () {
	clear();
	padTop = backgroundTop;
	padLeft = backgroundLeft;
	padBottom = backgroundBottom;
	padRight = backgroundRight;
	align = Align.center;
	debug(Debug.none);
	cellDefaults.defaults();
	for (int i = 0, n = columnDefaults.size; i < n; i++) {
		Cell columnCell = columnDefaults.get(i);
		if (columnCell != null) cellPool.free(columnCell);
	}
	columnDefaults.clear();
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:18,代碼來源:Table.java

示例2: BoardImage

import com.badlogic.gdx.scenes.scene2d.utils.Align; //導入方法依賴的package包/類
public BoardImage(final float imageWidth, final float imageHeight, final int nx, final int ny) {
  setDrawable(new TextureRegionDrawable(FourInALine.Instance.atlas.findRegion("hole")));
  this.scaling = Scaling.stretch;
  this.align = Align.center;
  this.nx = nx;
  this.ny = ny;
  xdim = (int)imageWidth / nx;
  ydim = (int)imageHeight / ny;
  setWidth((int)imageWidth);
  setHeight((int)imageHeight);
  tile = FourInALine.Instance.atlas.findRegion("hole");

  wood = FourInALine.Instance.wood;
  mask = new TextureRegion(FourInALine.Instance.mask);

  shader = new ShaderProgram(Gdx.files.internal("shaders/vertex.s"), Gdx.files.internal("shaders/fragment.s"));
  System.out.println(shader.isCompiled());
  System.out.println(shader.getLog());
}
 
開發者ID:alcacoop,項目名稱:it.alcacoop.fourinaline,代碼行數:20,代碼來源:BoardImage.java

示例3: DecoImage

import com.badlogic.gdx.scenes.scene2d.utils.Align; //導入方法依賴的package包/類
public DecoImage(Texture texture) {
    super(null, Scaling.stretch, Align.center);
    region = new TextureRegion(texture);
    setDrawable(new TextureRegionDrawable(region));
    setSize(getPrefWidth(), getPrefHeight());

    setBounds(0, 0, texture.getWidth(), texture.getHeight());
    setOrigin(texture.getWidth() / 2, texture.getHeight() / 2);
    setTouchable(Touchable.disabled);
}
 
開發者ID:GameDevWeek,項目名稱:CodeBase,代碼行數:11,代碼來源:DecoImage.java

示例4: createTable

import com.badlogic.gdx.scenes.scene2d.utils.Align; //導入方法依賴的package包/類
/**
 * Erstellt die Tabelle.
 * 
 * @param loot
 *            das Loot
 * @param maxWidth
 *            die Breite
 */
private void createTable(final Lootable loot, final float maxWidth) {
	group = new Table();

	Drawable drawable = loot.getImage();
	Image img = new Image(drawable, Scaling.fit, Align.center);
	Label name;

	labelStyle = new LabelStyle(
			AssetManager.getHeadlineFont(FontSize.FORTY), Color.GRAY);
	name = new Label(loot.getName(), labelStyle);

	labelStyle.font = AssetManager.getTextFont(FontSize.FORTY);
	description = new Label(loot.getDescription(), labelStyle);
	description.setWidth(maxWidth - 260);
	description.setWrap(true);

	nameAndDescription = new Table();
	nameAndDescription.align(Align.left + Align.top);
	nameAndDescription.add(name).expandX().align(Align.left).spaceLeft(10);
	nameAndDescription.row();
	nameAndDescription.add(description).align(Align.left).spaceLeft(10)
			.width(maxWidth - 260);
	nameAndDescription.setSize(nameAndDescription.getPrefWidth(),
			nameAndDescription.getPrefHeight());

	group.add(img).size(200).pad(10, 0, 10, 10);
	group.add(nameAndDescription).pad(10, 0, 10, 0);
	group.pad(0);

	contentHeight = group.getPrefHeight() + 10;

	group.setSize(maxWidth, contentHeight);
	group.setBackground(new TextureRegionDrawable(AssetManager
			.getTextureRegion("ui", "panel_beige")));
}
 
開發者ID:PhilippGrulich,項目名稱:HAW-SE2-projecthorse,代碼行數:44,代碼來源:LootItem.java

示例5: center

import com.badlogic.gdx.scenes.scene2d.utils.Align; //導入方法依賴的package包/類
/** Sets the alignment of widgets within the vertical group to {@link Align#center}. This clears any other alignment. */
public VerticalGroup center () {
	align = Align.center;
	return this;
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:6,代碼來源:VerticalGroup.java

示例6: center

import com.badlogic.gdx.scenes.scene2d.utils.Align; //導入方法依賴的package包/類
/** Sets the alignment of the actor within the container to {@link Align#center}. This clears any other alignment. */
public Container<T> center () {
	align = Align.center;
	return this;
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:6,代碼來源:Container.java

示例7: center

import com.badlogic.gdx.scenes.scene2d.utils.Align; //導入方法依賴的package包/類
/** Sets the alignment of the logical table within the table actor to {@link Align#center}. This clears any other alignment. */
public Table center () {
	align = Align.center;
	return this;
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:6,代碼來源:Table.java

示例8: Image

import com.badlogic.gdx.scenes.scene2d.utils.Align; //導入方法依賴的package包/類
/** Creates an image stretched, and aligned center.
 * @param patch May be null. */
public Image (NinePatch patch) {
	this(new NinePatchDrawable(patch), Scaling.stretch, Align.center);
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:6,代碼來源:Image.java

示例9: center

import com.badlogic.gdx.scenes.scene2d.utils.Align; //導入方法依賴的package包/類
/** Sets the alignment of widgets within the horizontal group to {@link Align#center}. This clears any other alignment. */
public HorizontalGroup center () {
	align = Align.center;
	return this;
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:6,代碼來源:HorizontalGroup.java


注:本文中的com.badlogic.gdx.scenes.scene2d.utils.Align.center方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。