本文整理匯總了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();
}
示例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());
}
示例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);
}
示例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")));
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}