本文整理匯總了Java中com.badlogic.gdx.scenes.scene2d.ui.Window類的典型用法代碼示例。如果您正苦於以下問題:Java Window類的具體用法?Java Window怎麽用?Java Window使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Window類屬於com.badlogic.gdx.scenes.scene2d.ui包,在下文中一共展示了Window類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: pauseGame
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
private void pauseGame() {
if (paused)
return;
paused = true;
final Window.WindowStyle pauseWindowStyle = new Window.WindowStyle();
pauseWindowStyle.titleFont = game.getFonts().get("moonhouse64");
pauseWindowStyle.background = new TextureRegionDrawable(new TextureRegion(background));
pauseWindow = new PauseWindow(pauseWindowStyle, game.getFonts().get("moonhouse64"), new Runnable() {
@Override
public void run() {
unpauseGame();
}
}, new Runnable() {
@Override
public void run() {
save();
}
}, game, uiAssets, button);
pauseWindow.setBounds(viewport.getWorldWidth() / 2 - viewport.getWorldWidth() / 3, viewport.getWorldHeight() / 2 - viewport.getWorldHeight() / 3, viewport.getWorldWidth() / 3 * 2, viewport.getWorldHeight() / 3 * 2);
stage.addActor(pauseWindow);
}
示例2: doBeforeShow
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
@Override
public void doBeforeShow(final Window dialog) {
// Too lazy to implement in LML. I'm tired.
scoresTable.clear();
final Array<Control> controls = controlsService.getControls();
for (int index = 0; index < controls.size; index++) {
final Control control = controls.get(index);
if (control.isActive() && control.isHumanControlled()) {
final VisLabel name = new VisLabel(
localeService.getI18nBundle().get(playerService.getSpriteType(index).name()),
VisUI.getSkin().getColor("vis-blue"));
scoresTable.add(name).expand().align(Align.left).padRight(5f);
scoresTable.add(String.valueOf(box2dService.getPoints(index))).expand().align(Align.right).padLeft(5f)
.row();
}
}
}
示例3: takeSnapshot
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
@Subscribe
@SuppressWarnings("unused")
public void takeSnapshot(CommandSnapshot command) {
if (ui != null) {
List<Window> windows = ui.getWindows();
for (int i = 0; i < windows.size(); i++) {
Window window = windows.get(i);
if (window instanceof SamplerEditor) {
if (window.isVisible()) {
SamplerEditor e = ((SamplerEditor) window);
String selectedSamplerId = e.getSelectedSamplerId();
if (selectedSamplerId != null) {
Editor.post(new CommandSnapshotBySampler(selectedSamplerId, 1, false));
}
}
}
}
}
}
示例4: LoginActor
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
public LoginActor(Skin skin) {
super(skin);
login = new Login();
Window loginWindow = new TWindow("", skin, "window2");
Label teacherName = new Label("Lehrer", skin);
teachersSelectBox = new SelectBox<String>(skin);
TextButton loginButton = new TextButton("Start", skin, "defaultBig");
setPosition(AppMain.WIDTH / 2, 225);
loginWindow.add(teacherName).row();
loginWindow.add(teachersSelectBox).width(175).row();
loginWindow.add(loginButton).width(175).height(100).colspan(2).padTop(40);
add(loginWindow);
loginButton.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
AppMain.user.login(teachersSelectBox.getSelected());
}
});
}
示例5: GUIContainerItem
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
public GUIContainerItem(String n, Window w, ItemType type, Vector2 vector2,
Vector2 vector22, int j, int i, int k, int l)
{
this.name = n;
this.type = type;
modal = w;
this.modal.setPosition(vector2.x / (float)Vars.getDouble("balancedScreenWidth"),
vector2.y / (float)Vars.getDouble("balancedScreenHeight"));
this.modal.setHeight(vector22.y / (float)Vars.getDouble("balancedScreenHeight"));
this.modal.setWidth(vector22.x / (float)Vars.getDouble("balancedScreenWidth"));
modal.defaults().padLeft(i);
modal.defaults().padRight(j);
modal.defaults().padTop(k);
modal.defaults().padBottom(l);
modal.defaults().minWidth(10);
modal.defaults().minHeight(10);
modal.add(new Image(GameManager.getTexture(type.name().toLowerCase(), TypeId.getTypeId(Type.Item))));
modal.setTitle("");
}
示例6: GUIList
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
public GUIList(String n, Window w, Vector2 vector2, Vector2 vector22,
int i, int j, int k, int l)
{
this.name = n;
this.window = w;
this.window.setName(n);
this.window.setPosition(vector2.x / (float)Vars.getDouble("balancedScreenWidth"),
vector2.y / (float)Vars.getDouble("balancedScreenHeight"));
this.window.setHeight(vector22.y / (float)Vars.getDouble("balancedScreenHeight"));
this.window.setWidth(vector22.x / (float)Vars.getDouble("balancedScreenWidth"));
window.defaults().padLeft(i);
window.defaults().padRight(j);
window.defaults().padTop(k);
window.defaults().padBottom(l);
window.defaults().minWidth(100);
window.defaults().minHeight(30);
}
示例7: GUIChatWindow
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
public GUIChatWindow()
{
this.name = "GenericWindow";
this.window = new Window(this.name,
GameManager.getSkin(GameManager.selectedSkin), "window");
this.window.setName(name);
this.window.setPosition(0 / (float)Vars.getDouble("balancedScreenWidth"),
0 / (float)Vars.getDouble("balancedScreenHeight"));
this.window.setHeight(0 / (float)Vars.getDouble("balancedScreenHeight"));
this.window.setWidth(0 / (float)Vars.getDouble("balancedScreenWidth"));
window.defaults().padLeft(0);
window.defaults().padRight(0);
window.defaults().padTop(0);
window.defaults().padBottom(0);
window.defaults().minWidth(100 / (float)Vars.getDouble("balancedScreenWidth"));
window.defaults().minHeight(30 / (float)Vars.getDouble("balancedScreenHeight"));
}
示例8: GUIWindow
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
public GUIWindow()
{
this.name = "GenericWindow";
this.window = new Window(this.name,
GameManager.getSkin(GameManager.selectedSkin), "window");
this.window.setName(name);
this.window.setPosition(0 / (float)Vars.getDouble("balancedScreenWidth"),
0 / (float)Vars.getDouble("balancedScreenHeight"));
this.window.setHeight(0 / (float)Vars.getDouble("balancedScreenHeight"));
this.window.setWidth(0 / (float)Vars.getDouble("balancedScreenWidth"));
window.defaults().padLeft(0);
window.defaults().padRight(0);
window.defaults().padTop(0);
window.defaults().padBottom(0);
window.defaults().minWidth(100 / (float)Vars.getDouble("balancedScreenWidth"));
window.defaults().minHeight(30 / (float)Vars.getDouble("balancedScreenHeight"));
mainTable = new Table();
mainTable.setFillParent(true);
mainTable.add(window);
mainActor = mainTable;
}
示例9: textWindowDemo
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
private void textWindowDemo() {
BitmapFont plotFont = context.getAssetManager().get( PLOT_FONT, BitmapFont.class );
String loremIpsum = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, ";
loremIpsum += "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";
loremIpsum += "\n\nThis window is draggable.";
rootAtlas = context.getAssetManager().get( ROOT_ATLAS, TextureAtlas.class );
TextureRegion plotDlgRegion = rootAtlas.findRegion( "box-text1" );
NinePatchDrawable plotDlgBgDrawable = new NinePatchDrawable( new NinePatch( plotDlgRegion, 20, 20, 35, 20 ) );
Window plotDlg = new Window( "", new Window.WindowStyle( plotFont, new Color( 1f, 1f, 1f, 1f ), plotDlgBgDrawable ) );
plotDlg.setKeepWithinStage( true );
plotDlg.setMovable( true );
plotDlg.setSize( 200, 250 );
plotDlg.setPosition( 765, 60 );
plotDlg.row().top().expand().fill();
Label plotLbl = new Label( loremIpsum, new Label.LabelStyle( plotFont, new Color( 1f, 1f, 1f, 1f ) ) );
plotLbl.setAlignment( Align.top|Align.left, Align.center|Align.left );
plotLbl.setWrap( true );
plotDlg.add( plotLbl );
// setKeepWithinStage() only applies if added to the stage root. :/
popupStage.addActor( plotDlg );
}
示例10: createWindowDebug
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
public static Window createWindowDebug(ResourcesManager resourcesManager){
BitmapFont font = (BitmapFont) resourcesManager.get(resourcesManager.DEBUG_FONT);
font.setScale(1 / 150F);
font.setUseIntegerPositions(false);
Window.WindowStyle style = new Window.WindowStyle();
//style.background = background;
style.titleFont = font;
style.titleFontColor=new Color(1, 1, 1, 0.4f);
Sprite background = new Sprite((Texture) resourcesManager.get(resourcesManager.DEBUG_BACKGROUND));
background.setSize(10,8);
background.setOrigin(background.getWidth() / 2, background.getHeight() / 2);
background.setColor(1,1,1,0.4f);
style.background= new SpriteDrawable(background);
Window window = new DebugWindow("", style);
window.setPosition(0, 0);
window.setKeepWithinStage(false);
window.setTransform(false);
window.setFillParent(true);
Label.LabelStyle labelStyle= new Label.LabelStyle(font,new Color(1, 1, 1, 1)) ;
myLabel= new Label("",labelStyle);
window.add(myLabel).pad(0.2f).width(8);
return window;
}
示例11: createWindowStyle
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
private Window.WindowStyle createWindowStyle() {
Window.WindowStyle style = new Window.WindowStyle();
style.background = new TextureRegionDrawable(new TextureRegion(backgroundTexture));
style.titleFont = titleFont;
style.titleFontColor = modalDialogDescriptor.getTitleFontColor();
style.stageBackground = new TextureRegionDrawable(new TextureRegion(stageBackgroundTexture));
return style;
}
示例12: UIManager
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
public UIManager(String title, Skin skin,IGameService service) {
super();
mainMenu = new Window(title, skin);
addActor(mainMenu);
this.components = getRoot();
this.batch = getSpriteBatch();
this.service = service;
}
示例13: onUpdate
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
@Override
public void onUpdate(final Window window, final Table table)
{
if (AllCameras == null && BlueIrisViewer.images != null)
{
AllCameras = BlueIrisViewer.images.GetCameraNamesStringArray();
if (AllCameras != null)
listAllCams.setItems(AllCameras);
}
}
示例14: onUpdate
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
@Override
protected void onUpdate(final Window window, final Table table)
{
IntRectangle currentPosition = BlueIrisViewer.windowHelper.GetWindowRectangle();
if (currentPosition.x != previousPosition.x)
txtWindowX.setText(String.valueOf(currentPosition.x));
if (currentPosition.y != previousPosition.y)
txtWindowY.setText(String.valueOf(currentPosition.y));
if (currentPosition.width != previousPosition.width)
txtWindowW.setText(String.valueOf(currentPosition.width));
if (currentPosition.height != previousPosition.height)
txtWindowH.setText(String.valueOf(currentPosition.height));
previousPosition = currentPosition;
}
示例15: UIElement
import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入依賴的package包/類
public UIElement(Skin skin)
{
UI.uiElements.add(this);
parent = new Table();
parent.setFillParent(true);
window = new Window("Unnamed Window", skin);
window.setModal(BlueIrisViewer.bivSettings.modalUI);
table = new Table(skin);
window.add(table);
hide();
parent.add(window);
onCreate(skin, window, table);
}