本文整理汇总了Java中com.kotcrab.vis.ui.widget.VisLabel.setAlignment方法的典型用法代码示例。如果您正苦于以下问题:Java VisLabel.setAlignment方法的具体用法?Java VisLabel.setAlignment怎么用?Java VisLabel.setAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.kotcrab.vis.ui.widget.VisLabel
的用法示例。
在下文中一共展示了VisLabel.setAlignment方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPreView
import com.kotcrab.vis.ui.widget.VisLabel; //导入方法依赖的package包/类
private void initPreView(int[] nines) {
previewTable.clear();
previewWidget = new PreviewWidget();
previewWidget.setHeight(205);
previewTable.add(previewWidget).width(200).height(205).top();
previewTable.row();
previewWidget.update(texture, nines);
VisLabel label = new VisLabel("Note: after saving, your \n scene will reload to \n apply changes.");
label.setAlignment(Align.center);
previewTable.add(label).pad(10).fillY().expandY();
previewTable.row();
saveBtn = new VisTextButton("apply and save");
previewTable.add(saveBtn).pad(5);
previewTable.row();
}
示例2: BlockUiProgress_Activity
import com.kotcrab.vis.ui.widget.VisLabel; //导入方法依赖的package包/类
public BlockUiProgress_Activity(CharSequence msg) {
super("BlockUiActivity");
// this.setDebug(true);
msgLabel = new VisLabel(msg);
Label.LabelStyle msgDefaultStyle = msgLabel.getStyle();
Label.LabelStyle newStyle = new Label.LabelStyle();
newStyle.fontColor = Color.WHITE;
newStyle.font = msgDefaultStyle.font;
msgLabel.setStyle(newStyle);
msgLabel.setAlignment(Align.center);
this.add(msgLabel).expandX().fillX().pad(CB.scaledSizes.MARGINx4);
this.row();
this.add(progress);
this.setBackground((Drawable) null);
}
示例3: ExpandEditTextButton
import com.kotcrab.vis.ui.widget.VisLabel; //导入方法依赖的package包/类
public ExpandEditTextButton(String text, Style style) {
super(style);
this.style = style;
label = new VisLabel(text, style.labelStyle);
label.setAlignment(Align.left);
label.setEllipsis(true);
labelCell = add(label).growX().left().width(new LabelCellWidthValue());
if (style.expandIcon != null) {
Image image = new Image(style.expandIcon);
image.setScaling(Scaling.none);
expandIconCell = add(image).padLeft(4f);
}
}
示例4: process
import com.kotcrab.vis.ui.widget.VisLabel; //导入方法依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final String rawAttributeData) {
VisLabel lblText = new VisLabel(parser.parseString(rawAttributeData, actor));
lblText.setAlignment(Align.center);
boolean needLineWrap = lblText.getPrefWidth() > LINE_WRAP_THRESHOLD;
if (needLineWrap) {
lblText.setWrap(true);
}
final Tooltip tooltip = new Tooltip();
tooltip.clearChildren(); // Removing empty cell with predefined paddings.
Cell<VisLabel> tooltipCell = tooltip.add(lblText).center().pad(0f, 4f, 2f, 4f);
if (needLineWrap) { tooltipCell.width(LINE_WRAP_THRESHOLD); }
tooltip.pack();
tooltip.setTarget(actor);
}
示例5: AtlasItem
import com.kotcrab.vis.ui.widget.VisLabel; //导入方法依赖的package包/类
public AtlasItem (String relativeAtlasPath, AtlasRegion region) {
super(VisUI.getSkin());
this.relativeAtlasPath = relativeAtlasPath;
this.region = region;
assetDescriptor = new AtlasRegionAsset(relativeAtlasPath, region.name);
setTouchable(Touchable.enabled);
setBackground("menu-bg");
Image img = new Image(region);
img.setScaling(Scaling.fit);
add(img).expand().fill().row();
VisLabel name = new VisLabel(region.name, "small");
name.setWrap(true);
name.setAlignment(Align.center);
add(name).expandX().fillX();
}
示例6: setupUI
import com.kotcrab.vis.ui.widget.VisLabel; //导入方法依赖的package包/类
private void setupUI() {
stage = new Stage();
VisTable root = new VisTable();
stage.addActor(root);
root.setFillParent(true);
root.align(Align.center);
VisLabel label = new VisLabel("It appears you have already opened an instance of this app.\n\n" +
"To ensure data integrity this is not possible. If you are sure that no open app " +
"instance exists delete the lock file ~/.gdxsplash/.lock and restart GdxSplash.");
label.setAlignment(Align.center);
label.setWrap(true);
root.add(label).pad(10).grow().row();
}
示例7: create
import com.kotcrab.vis.ui.widget.VisLabel; //导入方法依赖的package包/类
protected void create() {
// create a Label with name for default
nameLabel = new VisLabel(this.NAME);
nameLabel.setAlignment(Align.center);
nameLabel.setPosition(10, 10);
colorWidget = new ColorWidget(CB.getSkin().get("abstract_background", SkinColor.class));
colorWidget.setBounds(0, 0, this.getWidth(), this.getHeight());
this.addActor(colorWidget);
this.addActor(nameLabel);
}
示例8: FileTransfer_Activity
import com.kotcrab.vis.ui.widget.VisLabel; //导入方法依赖的package包/类
public FileTransfer_Activity() {
super("FileTransfer");
closeButton = new CharSequenceButton(Translation.get("close"));
closeButton.addListener(new ClickListener() {
public void clicked(InputEvent event, float x, float y) {
CharSequence msg = Translation.get("closeFileTransfer?");
CharSequence title = Translation.get("closeFileTransfer");
MessageBox.show(msg, title, MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk,
new OnMsgBoxClickListener() {
@Override
public boolean onClick(int which, Object data) {
if (which == ButtonDialog.BUTTON_POSITIVE) {
closeServer();
}
return true;
}
});
}
});
server = new FileBrowserServer(Gdx.files.absolute(CB.WorkPath), 9988, new FileBrowserServer.ConectionCloesRemoteReciver() {
@Override
public void close() {
closeServer();
}
});
server.startListening();
CharSequence message = Translation.get("StartFileTransferConnect", getIpAddress());
msgLabel = new VisLabel(message);
msgLabel.setAlignment(Alignment.CENTER.getAlignment());
this.add(msgLabel);
this.add(closeButton);
}
示例9: getCategoryItem
import com.kotcrab.vis.ui.widget.VisLabel; //导入方法依赖的package包/类
private ListViewItem getCategoryItem(int listIndex, final SettingCategory category) {
ListViewItem table = new ListViewItem(listIndex) {
@Override
public void dispose() {
}
};
// add label with category name, align left
table.left();
VisLabel label = new VisLabel(Translation.get(category.name()));
label.setAlignment(Align.left);
table.add(label).pad(CB.scaledSizes.MARGIN).expandX().fillX();
// add next icon
Image next = new Image(style.nextIcon);
table.add(next).width(next.getWidth()).pad(CB.scaledSizes.MARGIN / 2);
// add clicklistener
table.addListener(new ClickListener() {
public void clicked(InputEvent event, float x, float y) {
if (event.getType() == InputEvent.Type.touchUp) {
showCategory(category, true);
}
}
});
return table;
}
示例10: createDefaultView
import com.kotcrab.vis.ui.widget.VisLabel; //导入方法依赖的package包/类
private void createDefaultView (String type, String itemTypeName, boolean hideExtension) {
this.type = type;
VisLabel assetTypeLabel = new VisLabel((hideExtension ? "" : file.extension().toUpperCase() + " ") + itemTypeName, Color.GRAY);
assetTypeLabel.setWrap(true);
assetTypeLabel.setAlignment(Align.center);
add(assetTypeLabel).expandX().fillX().row();
name = new VisLabel(file.nameWithoutExtension());
}
示例11: AdjustableFavPointListViewItem
import com.kotcrab.vis.ui.widget.VisLabel; //导入方法依赖的package包/类
public AdjustableFavPointListViewItem(int listIndex, final IntProperty property, final CharSequence name) {
super(listIndex);
this.property = property;
this.name = name;
valueLabel = new VisLabel(Integer.toString(property.get()));
valueLabel.setAlignment(Align.center);
property.setChangeListener(new Property.PropertyChangedListener() {
@Override
public void propertyChanged() {
log.debug("Property {} changed to {}", name, property.get());
//property changed, so set name to "?"
filterSettings.filterProperties.setName("?");
}
});
// ListViewItem catch the ClickEvent from Button/Label
// So we reroute the event to the Button!
this.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
if (event.getTarget() instanceof VisTextButton
|| event.getTarget().getParent() instanceof VisTextButton) {
Array<EventListener> listeners = event.getTarget() instanceof VisTextButton ?
event.getTarget().getListeners() : event.getTarget().getParent().getListeners();
int n = listeners.size;
while (n-- > 0) {
EventListener listener = listeners.get(n);
if (listener instanceof ClickListener) {
((ClickListener) listener).clicked(event, x, y);
}
}
}
}
});
creatLayout();
setValue(property.get(), true);
}
示例12: initUI
import com.kotcrab.vis.ui.widget.VisLabel; //导入方法依赖的package包/类
private void initUI () {
uiTable = new VisTable(true) {
@Override
public float getPrefHeight () {
return 120;
}
};
uiTable.setBackground(VisUI.getSkin().getDrawable("window-bg"));
uiTable.setTouchable(Touchable.enabled);
uiTable.top().left();
uiTable.defaults().expandX().fillX().left();
uiTable.add(new VisLabel("Polygon Tool", Align.center)).expandX().fillX().top();
uiTable.row();
statusLabel = new VisLabel();
statusLabel.setWrap(true);
statusLabel.setAlignment(Align.center);
buttonTable = new VisTable(true) {
@Override
public float getPrefHeight () {
if (isVisible())
return super.getPrefHeight();
else
return 0;
}
@Override
public void setVisible (boolean visible) {
super.setVisible(visible);
invalidateHierarchy();
}
};
VisTextButton makeDefaultButton;
buttonTable.setVisible(false);
buttonTable.add(makeDefaultButton = new VisTextButton("Set From Bounds")).row();
buttonTable.add(traceButton = new VisTextButton("Auto Trace")).row();
dynamicUpdateCheck = new VisCheckBox("Dynamic faces update", true);
uiTable.add(statusLabel).pad(0, 3, 0, 3).height(new VisValue(context -> statusLabel.isVisible() ? statusLabel.getPrefHeight() : 0)).spaceBottom(0).row();
uiTable.add(buttonTable).height(new VisValue(context -> buttonTable.isVisible() ? buttonTable.getPrefHeight() : 0)).spaceBottom(0).row();
uiTable.add().expand().fill().row();
uiTable.add(dynamicUpdateCheck).expand(false, false).fill(false, false).center().padBottom(3);
makeDefaultButton.addListener(new VisChangeListener((event, actor) -> makeDefaultPolygon()));
traceButton.addListener(new VisChangeListener((event, actor) -> {
EntityProxy entity = entityManipulator.getSelectedEntities().first();
VisAssetDescriptor assetDescriptor = entity.getComponent(AssetReference.class).getAsset();
if (assetDescriptor instanceof TextureAssetDescriptor == false) {
Dialogs.showOKDialog(stage, "Message", "Auto Trace can only be used with sprite entities");
return;
}
if (entity.getRotation() != 0) {
Optional<DisableableOptionDialog> dialog = disableableDialogs.showOptionDialog(DisableableDialogsModule.POLYGON_TOOL_ROTATED_UNSUPPORTED, DefaultDialogOption.YES, stage, "Warning",
"Auto tracer does not support rotated entities",
OptionDialogType.YES_CANCEL, new OptionDialogAdapter() {
@Override
public void yes () {
showAutoTracerDialog(entity, assetDescriptor);
}
});
dialog.ifPresent(optDialog -> optDialog.setYesButtonText("Continue Anyway"));
} else {
showAutoTracerDialog(entity, assetDescriptor);
}
}));
}