本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Cell.getActor方法的典型用法代码示例。如果您正苦于以下问题:Java Cell.getActor方法的具体用法?Java Cell.getActor怎么用?Java Cell.getActor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Cell
的用法示例。
在下文中一共展示了Cell.getActor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: logMessage
import com.badlogic.gdx.scenes.scene2d.ui.Cell; //导入方法依赖的package包/类
/**
* Adds a new line of text to the log panel.
*
* This will create a new label and add it as new row
* to the log panel.
*
* The created label will use the supplied color.
*
* @param newText
* @return
*/
public void logMessage(String text, Color color, boolean logTime) {
Label label = newLabel(text, "logLabel");
if (!logTime) {
messages.add(label).fillX().expandX().align(Align.left).padLeft(10).top();
} else {
Table table = new Table();
table.add(new Label(GameState.getCurrentGameDate().toString(false), style.textStyle)).top();
table.add(label).padLeft(10).fillX().expandX().top();
messages.add(table).fillX().expandX().align(Align.left).padLeft(10).top();
}
messages.row();
label.setColor(color);
srollPane.layout();
srollPane.setScrollY(srollPane.getMaxY());
if (messages.getCells().size > Configuration.getMaxMessagesInLog()) {
@SuppressWarnings("rawtypes")
Cell cell = messages.getCells().removeIndex(0);
if (cell.getActor() != null) {
messages.removeActor((Actor) cell.getActor());
}
cell.clearActor();
}
}
示例2: ProgressTable
import com.badlogic.gdx.scenes.scene2d.ui.Cell; //导入方法依赖的package包/类
public ProgressTable(ShipProgressBar.ProgressType progressType) {
this.progressType = progressType;
String texturePrefix;
if (progressType == ShipProgressBar.ProgressType.SHIELD) {
texturePrefix = "ShieldProgressBar0";
} else {
texturePrefix = "progressBar0";
}
left().bottom();
images = new Image[8];
for (int i = 0; i < images.length; i++) {
int imageIndex = progressType == ShipProgressBar.ProgressType.SHIELD ? images.length - i - 1: i;
Image tmpImage = new Image(App.TEXTURES.findRegion(texturePrefix + ((imageIndex / 2) + 1)));
Cell<Image> imageCell = add(tmpImage).padLeft(5).padBottom(5);
images[i] = imageCell.getActor();
}
pack();
}
示例3: normalizeSecondCell
import com.badlogic.gdx.scenes.scene2d.ui.Cell; //导入方法依赖的package包/类
/** @param mainTable main table of {@link TabbedPane}. */
protected void normalizeSecondCell(final Table mainTable) {
if (GdxArrays.sizeOf(mainTable.getCells()) < 2) {
return;
}
final Cell<?> secondCell = mainTable.getCells().get(1);
if (secondCell.getActor() instanceof Image) {
secondCell.expand(true, false);
secondCell.fill(true, false);
}
}
示例4: normalizeSecondCell
import com.badlogic.gdx.scenes.scene2d.ui.Cell; //导入方法依赖的package包/类
/** @param mainTable main table of {@link TabbedPane}. */
protected void normalizeSecondCell(final Table mainTable) {
final Cell<?> secondCell = mainTable.getCells().get(1);
if (secondCell.getActor() instanceof Image) {
secondCell.expand(true, false);
secondCell.fill(true, false);
}
}