本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Table.align方法的典型用法代码示例。如果您正苦于以下问题:Java Table.align方法的具体用法?Java Table.align怎么用?Java Table.align使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Table
的用法示例。
在下文中一共展示了Table.align方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MessageWindow
import com.badlogic.gdx.scenes.scene2d.ui.Table; //导入方法依赖的package包/类
public MessageWindow(String message, BitmapFont font, float width, float height) {
setTouchable(Touchable.enabled);
setBounds(width / 2 - width / 4, height / 2 - height / 10, width / 2, height / 5);
texture = new Texture("theme/basic/ui/Window.png");
this.message = message;
table = new Table();
table.setSize(getWidth(), getHeight());
table.align(Align.center | Align.top);
table.setPosition(getX(), getY());
Label label = new Label(message, new Label.LabelStyle(font, Color.BLACK));
label.setWrap(true);
label.setFontScale(0.7f);
Label label2 = new Label("Tap to continue", new Label.LabelStyle(font, Color.BLACK));
label2.setFontScale(0.6f);
table.add(label).width(getWidth());
table.row();
table.add(label2).width(getWidth()).expandY();
table.pad(0, 30, 0, 30);
}
示例2: ConsoleDialog
import com.badlogic.gdx.scenes.scene2d.ui.Table; //导入方法依赖的package包/类
public ConsoleDialog(UserInterface linkedInterface)
{
super("Console", Settings.DEFAULT_SKIN);
this.linkedInterface = linkedInterface;
setBounds(400, 700, 600, 150);
Button closeButton = new CloseButton(this);
getTitleTable().add(closeButton).size(15, 15).padRight(-5).top().right();
Table table = getContentTable();
inputTextField = new TextField("", getSkin());
inputTextField.addListener(new InputListener(){
@Override
public boolean keyDown(InputEvent event, int keycode)
{
if(!ConsoleDialog.this.isVisible())
inputTextField.setDisabled(true);
if(keycode == Keys.ENTER)
{
addMessageToList();
sendCommandToExecute();
}
return false;
}
});
consolePane = new ConsolePane();
table.add(consolePane).fillX();
table.row();
table.add(inputTextField).width(570).align(Align.bottom);
table.align(Align.bottom);
}
示例3: ChatDialog
import com.badlogic.gdx.scenes.scene2d.ui.Table; //导入方法依赖的package包/类
public ChatDialog(UserInterface linkedInterface)
{
super("Chat", Settings.DEFAULT_SKIN);
this.linkedInterface = linkedInterface;
setBounds(0, 0, 400, 200);
Button closeButton = new CloseButton(this);
getTitleTable().add(closeButton).size(15, 15).padRight(-5).top().right();
Table table = getContentTable();
chatTextField = new TextField("", getSkin());
chatTextField.addListener(new InputListener(){
@Override
public boolean keyDown(InputEvent event, int keycode)
{
if(!ChatDialog.this.isVisible())
chatTextField.setDisabled(true);
if(keycode == Keys.ENTER)
sendMessage();
return false;
}
});
chatPane = new ChatPane();
table.add(chatPane).fillX();
table.row();
table.add(chatTextField).fillX().align(Align.bottom);
table.align(Align.bottom);
}