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


Java NinePatch.size方法代码示例

本文整理汇总了Java中com.watabou.noosa.NinePatch.size方法的典型用法代码示例。如果您正苦于以下问题:Java NinePatch.size方法的具体用法?Java NinePatch.size怎么用?Java NinePatch.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.watabou.noosa.NinePatch的用法示例。


在下文中一共展示了NinePatch.size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Window

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
public Window( int width, int height, NinePatch chrome ) {
	super();
	
	blocker = new TouchArea( 0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height ) {
		@Override
		protected void onClick( Touch touch ) {
			if (!Window.this.chrome.overlapsScreenPoint( 
				(int)touch.current.x, 
				(int)touch.current.y )) {
				
				onBackPressed();
			}
		}
	};
	blocker.camera = PixelScene.uiCamera;
	add( blocker );
	
	this.chrome = chrome;
	
	this.width = width;
	this.height = height;
	
	chrome.x = -chrome.marginLeft();
	chrome.y = -chrome.marginTop();
	chrome.size( 
		width - chrome.x + chrome.marginRight(),
		height - chrome.y + chrome.marginBottom() );
	add( chrome );
	
	camera = new Camera( 0, 0, 
		(int)chrome.width, 
		(int)chrome.height, 
		PixelScene.defaultZoom );
	camera.x = (int)(Game.width - camera.width * camera.zoom) / 2;
	camera.y = (int)(Game.height - camera.height * camera.zoom) / 2;
	camera.scroll.set( chrome.x, chrome.y );
	Camera.add( camera );
	
	Keys.event.add( this );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:41,代码来源:Window.java

示例2: Window

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
public Window( int width, int height, NinePatch chrome ) {
	super();

	TouchArea blocker = new TouchArea(0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height) {
		@Override
		protected void onTouchDown(Touch touch) {
			if (!Window.this.chrome.overlapsScreenPoint(
					(int) touch.current.x,
					(int) touch.current.y)) {

				onBackPressed();
			}
		}
	};
	blocker.camera = PixelScene.uiCamera;
	add(blocker);
	
	this.chrome = chrome;
	
	this.width = width;
	this.height = height;
	
	chrome.x = -chrome.marginLeft();
	chrome.y = -chrome.marginTop();
	chrome.size( 
		width - chrome.x + chrome.marginRight(),
		height - chrome.y + chrome.marginBottom() );
	add( chrome );
	
	camera = new Camera( 0, 0, 
		(int)chrome.width, 
		(int)chrome.height, 
		PixelScene.defaultZoom );
	camera.x = (int)(Game.width() - camera.width * camera.zoom) / 2;
	camera.y = (int)(Game.height() - camera.height * camera.zoom) / 2;
	camera.scroll.set( chrome.x, chrome.y );
	Camera.add( camera );
	
	Keys.event.add( this );
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:41,代码来源:Window.java

示例3: create

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
@Override
public void create() {
	super.create();

	int w = Camera.main.width;
	int h = Camera.main.height;

	RenderedText title = PixelScene.renderText(Messages.get(this, "title"), 9);
	title.hardlight(Window.TITLE_COLOR);
	title.x = (w - title.width()) / 2;
	title.y = 4;
	align(title);
	add(title);

	ExitButton btnExit = new ExitButton();
	btnExit.setPos(Camera.main.width - btnExit.width(), 0);
	add(btnExit);

	RenderedTextMultiline text = renderMultiline(TXT_Update, 6);

	NinePatch panel = Chrome.get(Chrome.Type.TOAST);

	int pw = 135 + panel.marginLeft() + panel.marginRight() - 2;
	int ph = h - 16;

	panel.size(pw, ph);
	panel.x = (w - pw) / 2f;
	panel.y = title.y + title.height();
	align(panel);
	add(panel);

	ScrollPane list = new ScrollPane(new Component());
	add(list);

	Component content = list.content();
	content.clear();

	text.maxWidth((int) panel.innerWidth());

	content.add(text);

	content.setSize(panel.innerWidth(), (int) Math.ceil(text.height()));

	list.setRect(
			panel.x + panel.marginLeft(),
			panel.y + panel.marginTop() - 1,
			panel.innerWidth(),
			panel.innerHeight() + 2);
	list.scrollTo(0, 0);

	Archs archs = new Archs();
	archs.setSize(Camera.main.width, Camera.main.height);
	addToBack(archs);

	fadeIn();
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:57,代码来源:ChangesScene.java

示例4: create

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
@Override
public void create() {
	super.create();

	int w = Camera.main.width;
	int h = Camera.main.height;

	RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9 );
	title.hardlight(Window.TITLE_COLOR);
	title.x = (w - title.width()) / 2 ;
	title.y = 4;
	align(title);
	add(title);

	ExitButton btnExit = new ExitButton();
	btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
	add( btnExit );

	RenderedTextMultiline text = renderMultiline(TXT_Update, 6 );

	NinePatch panel = Chrome.get(Chrome.Type.TOAST);

	int pw = 135 + panel.marginLeft() + panel.marginRight() - 2;
	int ph = h - 16;

	panel.size( pw, ph );
	panel.x = (w - pw) / 2f;
	panel.y = title.y + title.height();
	align( panel );
	add( panel );

	ScrollPane list = new ScrollPane( new Component() );
	add( list );

	Component content = list.content();
	content.clear();

	text.maxWidth((int) panel.innerWidth());

	content.add(text);

	content.setSize( panel.innerWidth(), (int)Math.ceil(text.height()) );

	list.setRect(
			panel.x + panel.marginLeft(),
			panel.y + panel.marginTop() - 1,
			panel.innerWidth(),
			panel.innerHeight() + 2);
	list.scrollTo(0, 0);

	Archs archs = new Archs();
	archs.setSize( Camera.main.width, Camera.main.height );
	addToBack( archs );

	fadeIn();
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:57,代码来源:ChangesScene.java

示例5: create

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
@Override
	public void create() {
		
		super.create();
		
		Music.INSTANCE.play( Assets.THEME, true );
		Music.INSTANCE.volume( 1f );
		
		uiCamera.visible = false;
		
		int w = Camera.main.width;
		int h = Camera.main.height;
		
		Archs archs = new Archs();
		archs.setSize( w, h );
		add( archs );
		
		int pw = Math.min( MAX_PANE_WIDTH, w - 6 );
		int ph = h - 30;
		
		NinePatch panel = Chrome.get( Chrome.Type.WINDOW );
		panel.size( pw, ph );
		panel.x = (w - pw) / 2;
		panel.y = (h - ph) / 2;
		add( panel );
		
		BitmapText title = PixelScene.createText( TXT_TITLE, 9 );
		title.hardlight( Window.TITLE_COLOR );
		title.measure();
		title.x = align( (w - title.width()) / 2 );
		title.y = align( (panel.y - title.baseLine()) / 2 );
		add( title );

		ScrollPane list = new BadgesList( true );
		add( list );

		list.setRect( 
			panel.x + panel.marginLeft(), 
			panel.y + panel.marginTop(), 
			panel.innerWidth(), 
			panel.innerHeight() );
		
		ExitButton btnExit = new ExitButton();
		btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
		add( btnExit );
		
		fadeIn();
		
//		Badges.loadingListener = new Callback() {
//			@Override
//			public void call() {
//				if (Game.scene() == BadgesScene.this) {
//					YetAnotherPixelDungeon.switchNoFade(BadgesScene.class);
//				}
//			}
//		};
	}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:58,代码来源:BadgesScene.java

示例6: Window

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
public Window( int width, int height, NinePatch chrome ) {
	super();
	
	blocker = new TouchArea( 0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height ) {
		@Override
		protected void onClick( Touch touch ) {
			if (!Window.this.chrome.overlapsScreenPoint( 
				(int)touch.current.x, 
				(int)touch.current.y )) {
				
				onBackPressed();
			}
		}
	};
	blocker.camera = PixelScene.uiCamera;
	add( blocker );
	
	this.chrome = chrome;
	
	this.width = width;
	this.height = height;
	
	shadow = new ShadowBox();
	shadow.am = 0.5f;
	shadow.camera = PixelScene.uiCamera.visible ? 
		PixelScene.uiCamera : Camera.main;
	add( shadow );
	
	chrome.x = -chrome.marginLeft();
	chrome.y = -chrome.marginTop();
	chrome.size( 
		width - chrome.x + chrome.marginRight(),
		height - chrome.y + chrome.marginBottom() );
	add( chrome );
	
	camera = new Camera( 0, 0, 
		(int)chrome.width, 
		(int)chrome.height, 
		PixelScene.defaultZoom );
	camera.x = (int)(Game.width - camera.width * camera.zoom) / 2;
	camera.y = (int)(Game.height - camera.height * camera.zoom) / 2;
	camera.scroll.set( chrome.x, chrome.y );
	Camera.add( camera );
	
	shadow.boxRect( 
		camera.x / camera.zoom, 
		camera.y / camera.zoom, 
		chrome.width(), chrome.height );
	
	Keys.event.add( this );
}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:52,代码来源:Window.java

示例7: create

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
@Override
public void create() {

	super.create();

	Music.INSTANCE.play( Assets.THEME, true );
	Music.INSTANCE.volume( 1f );

	uiCamera.visible = false;

	int w = Camera.main.width;
	int h = Camera.main.height;

	Archs archs = new Archs();
	archs.setSize( w, h );
	add( archs );

	int pw = Math.min( MAX_PANE_WIDTH, w - 6 );
	int ph = h - 30;

	NinePatch panel = Chrome.get( Chrome.Type.WINDOW );
	panel.size( pw, ph );
	panel.x = (w - pw) / 2;
	panel.y = (h - ph) / 2;
	add( panel );

	BitmapText title = PixelScene.createText( TXT_TITLE, 9 );
	title.hardlight( Window.TITLE_COLOR );
	title.measure();
	title.x = align( (w - title.width()) / 2 );
	title.y = align( (panel.y - title.baseLine()) / 2 );
	add( title );

	Badges.loadGlobal();

	ScrollPane list = new BadgesList( true );
	add( list );

	list.setRect(
			panel.x + panel.marginLeft(),
			panel.y + panel.marginTop(),
			panel.innerWidth(),
			panel.innerHeight() );

	ExitButton btnExit = new ExitButton();
	btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
	add( btnExit );

	fadeIn();

	Badges.loadingListener = new Callback() {
		@Override
		public void call() {
			if (Game.scene() == BadgesScene.this) {
				ShatteredPixelDungeon.switchNoFade( BadgesScene.class );
			}
		}
	};
}
 
开发者ID:FthrNature,项目名称:unleashed-pixel-dungeon,代码行数:60,代码来源:BadgesScene.java

示例8: Window

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
public Window( int width, int height, NinePatch chrome ) {
	super();
	
	blocker = new TouchArea( 0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height ) {
		@Override
		protected void onClick( Touch touch ) {
			if (!Window.this.chrome.overlapsScreenPoint(
				(int)touch.current.x,
				(int)touch.current.y )) {
				
				onBackPressed();
			}
		}
	};
	blocker.camera = PixelScene.uiCamera;
	add( blocker );
	
	this.chrome = chrome;

	this.width = width;
	this.height = height;

	shadow = new ShadowBox();
	shadow.am = 0.5f;
	shadow.camera = PixelScene.uiCamera.visible ?
			PixelScene.uiCamera : Camera.main;
	add( shadow );

	chrome.x = -chrome.marginLeft();
	chrome.y = -chrome.marginTop();
	chrome.size(
		width - chrome.x + chrome.marginRight(),
		height - chrome.y + chrome.marginBottom() );
	add( chrome );
	
	camera = new Camera( 0, 0,
		(int)chrome.width,
		(int)chrome.height,
		PixelScene.defaultZoom );
	camera.x = (int)(Game.width - camera.width * camera.zoom) / 2;
	camera.y = (int)(Game.height - camera.height * camera.zoom) / 2;
	camera.scroll.set( chrome.x, chrome.y );
	Camera.add( camera );

	shadow.boxRect(
			camera.x / camera.zoom,
			camera.y / camera.zoom,
			chrome.width(), chrome.height );

	Keys.event.add( this );
}
 
开发者ID:FthrNature,项目名称:unleashed-pixel-dungeon,代码行数:52,代码来源:Window.java

示例9: create

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
@Override
public void create() {
	
	super.create();
	
	Music.INSTANCE.play( Assets.THEME, true );
	Music.INSTANCE.volume( 1f );
	
	uiCamera.visible = false;
	
	int w = Camera.main.width;
	int h = Camera.main.height;
	
	Archs archs = new Archs();
	archs.setSize( w, h );
	add( archs );
	
	int pw = Math.min( 160, w - 6 );
	int ph = h - 30;
	
	NinePatch panel = Chrome.get( Chrome.Type.WINDOW );
	panel.size( pw, ph );
	panel.x = (w - pw) / 2;
	panel.y = (h - ph) / 2;
	add( panel );
	
	BitmapText title = PixelScene.createText( TXT_TITLE, 9 );
	title.hardlight( Window.TITLE_COLOR );
	title.measure();
	title.x = align( (w - title.width()) / 2 );
	title.y = align( (panel.y - title.baseLine()) / 2 );
	add( title );
	
	Badges.loadGlobal();
	
	ScrollPane list = new BadgesList( true );
	add( list );
	
	list.setRect( 
		panel.x + panel.marginLeft(), 
		panel.y + panel.marginTop(), 
		panel.innerWidth(), 
		panel.innerHeight() );

       ExitButton btnExit = new ExitButton();
       btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
       add( btnExit );
	
	fadeIn();
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:51,代码来源:BadgesScene.java

示例10: create

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
@Override
public void create() {

    super.create();

    Music.INSTANCE.play(Assets.THEME, true);
    Music.INSTANCE.volume(1f);

    uiCamera.visible = false;

    int w = Camera.main.width;
    int h = Camera.main.height;

    Archs archs = new Archs();
    archs.setSize(w, h);
    add(archs);

    int pw = Math.min(MAX_PANE_WIDTH, w - 6);
    int ph = h - 30;

    NinePatch panel = Chrome.get(Chrome.Type.WINDOW);
    panel.size(pw, ph);
    panel.x = (w - pw) / 2;
    panel.y = (h - ph) / 2;
    add(panel);

    BitmapText title = PixelScene.createText(TXT_TITLE, 9);
    title.hardlight(Window.TITLE_COLOR);
    title.measure();
    title.x = align((w - title.width()) / 2);
    title.y = align((panel.y - title.baseLine()) / 2);
    add(title);

    Badges.loadGlobal();

    ScrollPane list = new BadgesList(true);
    add(list);

    list.setRect(
            panel.x + panel.marginLeft(),
            panel.y + panel.marginTop(),
            panel.innerWidth(),
            panel.innerHeight());

    ExitButton btnExit = new ExitButton();
    btnExit.setPos(Camera.main.width - btnExit.width(), 0);
    add(btnExit);

    fadeIn();

    Badges.loadingListener = new Callback() {
        @Override
        public void call() {
            if (Game.scene() == BadgesScene.this) {
                PixelDungeon.switchNoFade(BadgesScene.class);
            }
        }
    };
}
 
开发者ID:skynet67,项目名称:pixel-dungeon-rebirth,代码行数:60,代码来源:BadgesScene.java

示例11: Window

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
public Window(int width, int height, NinePatch chrome) {
    super();

    blocker = new TouchArea(0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height) {
        @Override
        protected void onClick(NoosaInputProcessor.Touch touch) {
            if (!Window.this.chrome.overlapsScreenPoint(
                    (int) touch.current.x,
                    (int) touch.current.y)) {

                onBackPressed();
            }
        }
    };
    blocker.camera = PixelScene.uiCamera;
    add(blocker);

    this.chrome = chrome;

    this.width = width;
    this.height = height;

    shadow = new ShadowBox();
    shadow.am = 0.5f;
    shadow.camera = PixelScene.uiCamera.visible ?
            PixelScene.uiCamera : Camera.main;
    add(shadow);

    chrome.x = -chrome.marginLeft();
    chrome.y = -chrome.marginTop();
    chrome.size(
            width - chrome.x + chrome.marginRight(),
            height - chrome.y + chrome.marginBottom());
    add(chrome);

    camera = new Camera(0, 0,
            (int) chrome.width,
            (int) chrome.height,
            PixelScene.defaultZoom);
    camera.x = (int) (Game.width - camera.width * camera.zoom) / 2;
    camera.y = (int) (Game.height - camera.height * camera.zoom) / 2;
    camera.scroll.set(chrome.x, chrome.y);
    Camera.add(camera);

    shadow.boxRect(
            camera.x / camera.zoom,
            camera.y / camera.zoom,
            chrome.width(), chrome.height);

    Game.instance.getInputProcessor().addKeyListener(this);
}
 
开发者ID:skynet67,项目名称:pixel-dungeon-rebirth,代码行数:52,代码来源:Window.java

示例12: Window

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
public Window( int width, int height, int yOffset, NinePatch chrome ) {
	super();

	this.yOffset = yOffset;
	
	blocker = new TouchArea( 0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height ) {
		@Override
		protected void onClick( Touch touch ) {
			if (Window.this.parent != null && !Window.this.chrome.overlapsScreenPoint(
				(int)touch.current.x,
				(int)touch.current.y )) {
				
				onBackPressed();
			}
		}
	};
	blocker.camera = PixelScene.uiCamera;
	add( blocker );
	
	this.chrome = chrome;

	this.width = width;
	this.height = height;

	shadow = new ShadowBox();
	shadow.am = 0.5f;
	shadow.camera = PixelScene.uiCamera.visible ?
			PixelScene.uiCamera : Camera.main;
	add( shadow );

	chrome.x = -chrome.marginLeft();
	chrome.y = -chrome.marginTop();
	chrome.size(
		width - chrome.x + chrome.marginRight(),
		height - chrome.y + chrome.marginBottom() );
	add( chrome );
	
	camera = new Camera( 0, 0,
		(int)chrome.width,
		(int)chrome.height,
		PixelScene.defaultZoom );
	camera.x = (int)(Game.width - camera.width * camera.zoom) / 2;
	camera.y = (int)(Game.height - camera.height * camera.zoom) / 2;
	camera.y -= yOffset * camera.zoom;
	camera.scroll.set( chrome.x, chrome.y );
	Camera.add( camera );

	shadow.boxRect(
			camera.x / camera.zoom,
			camera.y / camera.zoom,
			chrome.width(), chrome.height );

	Keys.event.add( this );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:55,代码来源:Window.java

示例13: create

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
@Override
public void create() {
	super.create();
	
	Music.INSTANCE.play( Assets.THEME, true );
	Music.INSTANCE.volume( 1f );
	
	uiCamera.setVisible(false);
	
	int w = Camera.main.width;
	int h = Camera.main.height;
	
	Archs archs = new Archs();
	archs.setSize( w, h );
	add( archs );
	
	int pw = Math.min( 160, w - 6 );
	int ph = h - 30;
	
	NinePatch panel = Chrome.get( Chrome.Type.WINDOW );
	panel.size( pw, ph );
	panel.x = (w - pw) / 2;
	panel.y = (h - ph) / 2;
	add( panel );
	
	Text title = PixelScene.createText( TXT_TITLE, GuiProperties.titleFontSize());
	title.hardlight( Window.TITLE_COLOR );
	title.measure();
	title.x = align( (w - title.width()) / 2 );
	title.y = align( (panel.y - title.baseLine()) / 2 );
	add( title );
	
	Badges.loadGlobal();
	
	ScrollPane list = new BadgesList( true );
	add( list );
	
	list.setRect( 
		panel.x + panel.marginLeft(), 
		panel.y + panel.marginTop(), 
		panel.innerWidth(), 
		panel.innerHeight() );
	
	ExitButton btnExit = new ExitButton();
	btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
	add( btnExit );
	
	fadeIn();
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:50,代码来源:BadgesScene.java

示例14: create

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
@Override
public void create() {
	super.create();

	Text title = createMultiline(TTL_Welcome, GuiProperties.bigTitleFontSize());

	int w = Camera.main.width;
	int h = Camera.main.height;

	int pw = w - 10;

	title.maxWidth(pw);
	title.measure();

	title.x = align((w - title.width()) / 2);
	title.y = align(8);
	add(title);

	NinePatch panel = Chrome.get(Chrome.Type.WINDOW);

	panel.x = (w - pw) / 2;
	panel.y = title.y + title.height() + GAP * 2;
	int ph = (int) (h - panel.y - 22);

	panel.size(pw, ph);

	add(panel);

	ScrollPane list = new ScrollPane(new Component());
	add(list);
	list.setRect(panel.x + panel.marginLeft(), panel.y + panel.marginTop(), panel.innerWidth(),
			panel.innerHeight());
	list.scrollTo(0, 0);

	Component content = list.content();
	content.clear();

	float yPos = 0;
	Text text = createMultiline(Game.getVar(R.string.AllowStatisticsCollectionScene_Request), GuiProperties.regularFontSize());
	text.maxWidth((int) panel.innerWidth());
	text.measure();

	content.add(text);
	yPos += text.height() + GAP;

	content.setSize(panel.innerWidth(), yPos);

	RedButton allow = new RedButton(Game.getVar(R.string.AllowStatisticsCollectionScene_Allow)) {
		@Override
		protected void onClick() {
			Preferences.INSTANCE.put(Preferences.KEY_COLLECT_STATS, 100);
			Game.instance().initEventCollector();
			Game.switchScene(TitleScene.class);
		}
	};

	RedButton deny = new RedButton(Game.getVar(R.string.AllowStatisticsCollectionScene_Deny)) {
		@Override
		protected void onClick() {
			Preferences.INSTANCE.put(Preferences.KEY_COLLECT_STATS, -100);
			Game.instance().initEventCollector();
			Game.switchScene(TitleScene.class);
		}
	};

	allow.setRect((w - pw) / 2, h - 22, pw/2 - GAP, 18);
	deny.setRect((w - pw) / 2 + pw/2 , h - 22, pw/2-GAP, 18);
	add(allow);
	add(deny);

	Archs archs = new Archs();
	archs.setSize(Camera.main.width, Camera.main.height);
	addToBack(archs);

	fadeIn();
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:77,代码来源:AllowStatisticsCollectionScene.java

示例15: Window

import com.watabou.noosa.NinePatch; //导入方法依赖的package包/类
public Window( int width, int height, int yOffset, NinePatch chrome ) {
	super();

	this.yOffset = yOffset;
	
	blocker = new TouchArea( 0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height ) {
		@Override
		protected void onClick( NoosaInputProcessor.Touch touch ) {
			if (Window.this.parent != null && !Window.this.chrome.overlapsScreenPoint(
				(int)touch.current.x,
				(int)touch.current.y )) {
				
				onBackPressed();
			}
		}
	};
	blocker.camera = PixelScene.uiCamera;
	add( blocker );
	
	this.chrome = chrome;

	this.width = width;
	this.height = height;

	shadow = new ShadowBox();
	shadow.am = 0.5f;
	shadow.camera = PixelScene.uiCamera.visible ?
			PixelScene.uiCamera : Camera.main;
	add( shadow );

	chrome.x = -chrome.marginLeft();
	chrome.y = -chrome.marginTop();
	chrome.size(
		width - chrome.x + chrome.marginRight(),
		height - chrome.y + chrome.marginBottom() );
	add( chrome );
	
	camera = new Camera( 0, 0,
		(int)chrome.width,
		(int)chrome.height,
		PixelScene.defaultZoom );
	camera.x = (int)(Game.width - camera.width * camera.zoom) / 2;
	camera.y = (int)(Game.height - camera.height * camera.zoom) / 2;
	camera.y -= yOffset * camera.zoom;
	camera.scroll.set( chrome.x, chrome.y );
	Camera.add( camera );

	shadow.boxRect(
			camera.x / camera.zoom,
			camera.y / camera.zoom,
			chrome.width(), chrome.height );

	Game.instance.getInputProcessor().addKeyListener(this);
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon-gdx,代码行数:55,代码来源:Window.java


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