當前位置: 首頁>>代碼示例>>Java>>正文


Java Window.setKeepWithinStage方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.scenes.scene2d.ui.Window.setKeepWithinStage方法的典型用法代碼示例。如果您正苦於以下問題:Java Window.setKeepWithinStage方法的具體用法?Java Window.setKeepWithinStage怎麽用?Java Window.setKeepWithinStage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.scenes.scene2d.ui.Window的用法示例。


在下文中一共展示了Window.setKeepWithinStage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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 );
}
 
開發者ID:Vhati,項目名稱:OverdriveGDX,代碼行數:27,代碼來源:TestScreen.java

示例2: 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;
    }
 
開發者ID:Rubentxu,項目名稱:DreamsLibGdx,代碼行數:27,代碼來源:DebugWindow.java

示例3: process

import com.badlogic.gdx.scenes.scene2d.ui.Window; //導入方法依賴的package包/類
@Override
public void process(final LmlParser parser, final LmlTag tag, final Window actor, final String rawAttributeData) {
    actor.setKeepWithinStage(parser.parseBoolean(rawAttributeData, actor));
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:5,代碼來源:KeepWithinStageLmlAttribute.java


注:本文中的com.badlogic.gdx.scenes.scene2d.ui.Window.setKeepWithinStage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。