当前位置: 首页>>代码示例>>Java>>正文


Java TextArea类代码示例

本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.TextArea的典型用法代码示例。如果您正苦于以下问题:Java TextArea类的具体用法?Java TextArea怎么用?Java TextArea使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TextArea类属于com.badlogic.gdx.scenes.scene2d.ui包,在下文中一共展示了TextArea类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import com.badlogic.gdx.scenes.scene2d.ui.TextArea; //导入依赖的package包/类
@Override
public void create () {
	stage = new Stage();
	Gdx.input.setInputProcessor(stage);
	skin = new Skin(Gdx.files.internal("data/uiskin.json"));
	TextArea textArea = new TextArea(
		"Text Area\nEssentially, a text field\nwith\nmultiple\nlines.\n"
			+ "It can even handle very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong lines.",
		skin);
	textArea.setX(10);
	textArea.setY(10);
	textArea.setWidth(200);
	textArea.setHeight(200);

	TextField textField = new TextField("Text field", skin);
	textField.setX(10);
	textField.setY(220);
	textField.setWidth(200);
	textField.setHeight(30);
	stage.addActor(textArea);
	stage.addActor(textField);
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:23,代码来源:TextAreaTest.java

示例2: build

import com.badlogic.gdx.scenes.scene2d.ui.TextArea; //导入依赖的package包/类
@Override
protected void build() {
    float pad = 5 * GlobalConf.SCALE_FACTOR;
    float tawidth = 500 * GlobalConf.SCALE_FACTOR;

    String meminfostr = "";
    for (MemoryPoolMXBean mpBean : ManagementFactory.getMemoryPoolMXBeans()) {
        meminfostr += txt("gui.help.name") + ": " + mpBean.getName() + ": " + mpBean.getUsage() + "\n";
    }

    TextArea meminfo = new OwnTextArea(meminfostr, skin, "no-disabled");
    meminfo.setDisabled(true);
    meminfo.setPrefRows(10);
    meminfo.setWidth(tawidth);
    meminfo.clearListeners();

    meminfoscroll = new OwnScrollPane(meminfo, skin, "minimalist-nobg");
    meminfoscroll.setWidth(tawidth);
    meminfoscroll.setForceScroll(false, true);
    meminfoscroll.setSmoothScrolling(true);
    meminfoscroll.setFadeScrollBars(false);

    add(meminfoscroll).align(Align.center).pad(pad);

}
 
开发者ID:langurmonkey,项目名称:gaiasky,代码行数:26,代码来源:MemInfoWindow.java

示例3: addTextArea

import com.badlogic.gdx.scenes.scene2d.ui.TextArea; //导入依赖的package包/类
private void addTextArea(Table table, Element element) {
	ObjectMap<String, String> atrributes = element.getAttributes();

	TextArea textArea = new TextArea(element.get("text", ""), skin);
	Cell<TextArea> cell = table.add(textArea);

	for (String key : atrributes.keys()) {
		if (key.equalsIgnoreCase("name")) {
			textArea.setName(atrributes.get(key));
		}
	}
	cellPrepare(cell, atrributes);
	actorsMap.put(textArea.getName(), textArea);

}
 
开发者ID:Radomiej,项目名称:JavityEngine,代码行数:16,代码来源:JXmlUi.java

示例4: DeveloperInfo

import com.badlogic.gdx.scenes.scene2d.ui.TextArea; //导入依赖的package包/类
public DeveloperInfo(Skin skin, CenterWindowManager centerWindowManager) {
    super("Dev Info", skin, centerWindowManager);
    stats = new TextArea("", skin);
    stats.setDisabled(true);

    textAreaCell = this.add(stats);
}
 
开发者ID:Tatskaari,项目名称:DungeonCrawler,代码行数:8,代码来源:DeveloperInfo.java

示例5: createWidget

import com.badlogic.gdx.scenes.scene2d.ui.TextArea; //导入依赖的package包/类
@Override
public AbstractWidget createWidget(Controller controller) {
	Skin skin = controller.getApplicationAssets().getSkin();
	LinearLayout layout = new LinearLayout(false);
	layout.add(new Label("This a test label with some text.", skin));
	layout.add(new TextField("This a text field with some text", skin));
	TextArea textArea = new TextArea(
			"This is a text area with some text \nin \nseveral \nlines",
			skin);
	textArea.setPrefRows(10);
	layout.add(textArea);
	SelectBox<String> selectBox = new SelectBox<String>(skin);
	String[] items = new String[200];
	for (int i = 0; i < 200; i++) {
		items[i] = "String " + i;
	}
	selectBox.setItems(items);
	layout.add(selectBox);
	layout.add(new Spinner(skin, 0.1f));

	// Buttons
	LinearLayout buttonsLayout = new LinearLayout(true);
	buttonsLayout.add(new Label("Buttons: ", skin));
	buttonsLayout.add(new Button(skin));
	buttonsLayout.add(new TextButton("Button with text", skin));
	buttonsLayout.add(new ImageButton(skin.getDrawable("undo24x24"), skin
			.getDrawable("redo24x24")));
	layout.add(buttonsLayout);
	// layout.add(new Slider(0, 10, 1, false, skin));
	return layout;
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:32,代码来源:UITest.java

示例6: text

import com.badlogic.gdx.scenes.scene2d.ui.TextArea; //导入依赖的package包/类
/**
 * Creates a text option (text area)
 * 
 * @param field
 *            the field
 * @param widgetLines
 *            lines to be shown by the widget
 */
public StringController text(String field, int widgetLines) {
	Option option = panel.text(label(field), tooltip(field), widgetLines);
	TextArea textArea = (TextArea) option.getOptionWidget();
	StringController value = newValueController(StringController.class,
			textArea);
	add(field, option, value);
	return value;
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:17,代码来源:OptionsController.java

示例7: getHandledType

import com.badlogic.gdx.scenes.scene2d.ui.TextArea; //导入依赖的package包/类
@Override
public Class<TextArea> getHandledType() {
    return TextArea.class;
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:5,代码来源:PrefRowsLmlAttribute.java

示例8: process

import com.badlogic.gdx.scenes.scene2d.ui.TextArea; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final TextArea actor, final String rawAttributeData) {
    actor.setPrefRows(parser.parseFloat(rawAttributeData, actor));
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:5,代码来源:PrefRowsLmlAttribute.java

示例9: getNewInstanceOfTextField

import com.badlogic.gdx.scenes.scene2d.ui.TextArea; //导入依赖的package包/类
@Override
protected TextField getNewInstanceOfTextField(final TextLmlActorBuilder textBuilder) {
    final TextArea textArea = new TextArea(textBuilder.getText(), getSkin(textBuilder), textBuilder.getStyleName());
    LmlUtilities.getLmlUserObject(textArea).setData(Boolean.TRUE); // Setting as multiline by default.
    return textArea;
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:7,代码来源:TextAreaLmlTag.java

示例10: addNormalWidgets

import com.badlogic.gdx.scenes.scene2d.ui.TextArea; //导入依赖的package包/类
private void addNormalWidgets () {
	Skin skin = VisUI.getSkin();

	TextArea textArea = new TextArea("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis odio.", skin);
	textArea.setPrefRows(5);

	// ---

	VisTable table = new VisTable();

	for (int i = 0; i < 20; i++)
		table.add(new Label("Label #" + (i + 1), skin)).expand().fill().row();

	ScrollPane scrollPane = new ScrollPane(table, skin, "list");
	scrollPane.setFlickScroll(false);
	scrollPane.setFadeScrollBars(false);

	// ---

	add(textArea).row();
	add(scrollPane).spaceTop(8).fillX().expandX().row();
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:23,代码来源:TestTextAreaAndScroll.java

示例11: text

import com.badlogic.gdx.scenes.scene2d.ui.TextArea; //导入依赖的package包/类
/**
 * Creates a text option, with a text area as widget
 * 
 * @param label
 *            the label for the option
 * @param tooltip
 *            the tooltip for the option (can be null)
 * @param maxLines
 *            the number of lines for the text area
 * @return the option created
 */
public Option text(String label, String tooltip, int maxLines) {
	TextArea textArea = new TextArea("", skin);
	textArea.setPrefRows(maxLines);
	Option option = newOption(label, tooltip, textArea);
	addOption(option);
	return option;
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:19,代码来源:OptionsPanel.java


注:本文中的com.badlogic.gdx.scenes.scene2d.ui.TextArea类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。