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