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


Java Component类代码示例

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


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

示例1: WndHardNotification

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public WndHardNotification(Component titlebar, String message, String btnMessage, int time) {
	super(titlebar, message);

	timeLeft = time;
	this.btnMessage = btnMessage;

	btnOkay = new RedButton(btnMessage + " (" + time +")"){
		@Override
		protected void onClick() {
			hide();
		}
	};
	btnOkay.setRect(0, height + GAP, width, 16);
	btnOkay.enable(false);
	add(btnOkay);

	resize(width, (int) btnOkay.bottom());
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:19,代码来源:WndHardNotification.java

示例2: WndChanges

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public WndChanges() {
    super();
    resize( WIDTH, HEIGHT );

    txtTitle = PixelScene.createText(TXT_TITLE, 9);
    txtTitle.hardlight( Window.SHPX_COLOR );
    txtTitle.measure();
    txtTitle.x = PixelScene.align( PixelScene.uiCamera, (WIDTH - txtTitle.width()) / 2 );
    add( txtTitle );

    BitmapTextMultiline txtChanges = PixelScene.createMultiline(TXT_CHANGES, 9);

    Component content = new Component();

    content.add(txtChanges);

    text = new ScrollPane( content ) {

    };
    add( text );
    text.setRect( 0, txtTitle.height(), WIDTH, HEIGHT - txtTitle.height() );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:23,代码来源:WndChanges.java

示例3: WndJournal

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public WndJournal() {

		super();
		resize(WIDTH, ShatteredPixelDungeon.landscape() ? HEIGHT_L : HEIGHT_P);

		txtTitle = PixelScene.renderText(TXT_TITLE, 9);
		txtTitle.hardlight(Window.TITLE_COLOR);
		txtTitle.x = PixelScene.align(PixelScene.uiCamera,
				(WIDTH - txtTitle.width()) / 2);
		add(txtTitle);

		Component content = new Component();

		Collections.sort(Journal.records);

		float pos = 0;
		for (Journal.Record rec : Journal.records) {
			ListItem item = new ListItem(rec.feature, rec.depth);
			item.setRect(0, pos, WIDTH, ITEM_HEIGHT);
			content.add(item);

			pos += item.height();
		}

		content.setSize(WIDTH, pos);

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

		list.setRect(0, txtTitle.height(), WIDTH, height - txtTitle.height());
	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:32,代码来源:WndJournal.java

示例4: ScrollPane

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public ScrollPane(Component content) {
	super();

	this.content = content;
	addToBack(content);

	width = content.width();
	height = content.height();

	content.camera = new Camera(0, 0, 1, 1, PixelScene.defaultZoom);
	Camera.add(content.camera);
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:13,代码来源:ScrollPane.java

示例5: ScrollPane

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public ScrollPane( Component content ) {
	super();

	this.content = content;
	addToBack( content );

	width = content.width();
	height = content.height();

	content.camera = new Camera( 0, 0, 1, 1, PixelScene.defaultZoom );
	Camera.add( content.camera );
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:13,代码来源:ScrollPane.java

示例6: BadgesList

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public BadgesList( boolean global ) {
	super( new Component() );
	
	for (Badges.Badge badge : Badges.filtered( global )) {
		
		if (badge.image == -1) {
			continue;
		}
		
		ListItem item = new ListItem( badge );
		content.add( item );
		items.add( item );
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:15,代码来源:BadgesList.java

示例7: WndJournal

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public WndJournal() {
	
	super();
	resize( WIDTH, PixelDungeon.landscape() ? HEIGHT_L : HEIGHT_P );
	
	txtTitle = PixelScene.createText( TXT_TITLE, 9 );
	txtTitle.hardlight( Window.TITLE_COLOR );
	txtTitle.measure();
	txtTitle.x = PixelScene.align( PixelScene.uiCamera, (WIDTH - txtTitle.width()) / 2 );
	add( txtTitle );
	
	Component content = new Component();
	
	Collections.sort( Journal.records );
	
	float pos = 0;
	for (Journal.Record rec : Journal.records) {
		ListItem item = new ListItem( rec.feature, rec.depth );
		item.setRect( 0, pos, WIDTH, ITEM_HEIGHT );
		content.add( item );
		
		pos += item.height();
	}
	
	content.setSize( WIDTH, pos );
	
	list = new ScrollPane( content );
	add( list );
	
	list.setRect( 0, txtTitle.height(), WIDTH, height - txtTitle.height() );
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:32,代码来源:WndJournal.java

示例8: WndTitledMessage

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public WndTitledMessage( Component titlebar, String message ) {
	
	super();
	
	int width = YetAnotherPixelDungeon.landscape() ? WIDTH_L : WIDTH_P;
	
	titlebar.setRect( 0, 0, width, 0 );
	add( titlebar );
	
	Highlighter hl = new Highlighter( message );
	
	normal = PixelScene.createMultiline( hl.text, 6 );
	normal.maxWidth = width;
	normal.measure();
	normal.x = titlebar.left();
	normal.y = titlebar.bottom() + GAP;
	add( normal );
	
	if (hl.isHighlighted()) {
		normal.mask = hl.inverted();
		
		highlighted = PixelScene.createMultiline( hl.text, 6 );
		highlighted.maxWidth = normal.maxWidth;
		highlighted.measure();
		highlighted.x = normal.x;
		highlighted.y = normal.y;
		add( highlighted );

		highlighted.mask = hl.mask;
		highlighted.hardlight( TITLE_COLOR );
	}
	
	resize( width, (int)(normal.y + normal.height()) );
}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:35,代码来源:WndTitledMessage.java

示例9: ScrollPane

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public ScrollPane( Component content ) {
	super();
	
	this.content = content;
	addToBack( content );
	
	width = content.width();
	height = content.height();
	
	content.camera = new Camera( 0, 0, 1, 1, PixelScene.defaultZoom );
	Camera.add( content.camera );
}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:13,代码来源:ScrollPane.java

示例10: WndTitledMessage

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public WndTitledMessage( Component titlebar, String message ) {
	
	super();

	int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P;

	titlebar.setRect( 0, 0, width, 0 );
	add( titlebar );
	
	Highlighter hl = new Highlighter( message );
	
	normal = PixelScene.createMultiline( hl.text, 6 );
	normal.maxWidth = width;
	normal.measure();
	normal.x = titlebar.left();
	normal.y = titlebar.bottom() + GAP;
	add( normal );
	
	if (hl.isHighlighted()) {
		normal.mask = hl.inverted();
		
		highlighted = PixelScene.createMultiline( hl.text, 6 );
		highlighted.maxWidth = normal.maxWidth;
		highlighted.measure();
		highlighted.x = normal.x;
		highlighted.y = normal.y;
		add( highlighted );

		highlighted.mask = hl.mask;
		highlighted.hardlight( TITLE_COLOR );
	}
	
	resize( width, (int)(normal.y + normal.height()) );
}
 
开发者ID:FthrNature,项目名称:unleashed-pixel-dungeon,代码行数:35,代码来源:WndTitledMessage.java

示例11: WndJournal

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public WndJournal() {
	
	super();
	resize( WIDTH, ShatteredPixelDungeon.landscape() ? HEIGHT_L : HEIGHT_P );

	txtTitle = PixelScene.createText( TXT_TITLE, 9 );
	txtTitle.hardlight( Window.TITLE_COLOR );
	txtTitle.measure();
	txtTitle.x = PixelScene.align( PixelScene.uiCamera, (WIDTH - txtTitle.width()) / 2 );
	add( txtTitle );
	
	Component content = new Component();
	
	Collections.sort( Journal.records );
	
	float pos = 0;
	for (Journal.Record rec : Journal.records) {
		ListItem item = new ListItem( rec.feature, rec.depth );
		item.setRect( 0, pos, WIDTH, ITEM_HEIGHT );
		content.add( item );
		
		pos += item.height();
	}
	
	content.setSize( WIDTH, pos );
	
	list = new ScrollPane( content );
	add( list );

	list.setRect( 0, txtTitle.height(), WIDTH, height - txtTitle.height() );
}
 
开发者ID:FthrNature,项目名称:unleashed-pixel-dungeon,代码行数:32,代码来源:WndJournal.java

示例12: WndTitledMessage

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public WndTitledMessage( Component titlebar, String message ) {
	
	super();
	
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	Highlighter hl = new Highlighter( message );
	
	normal = PixelScene.createMultiline( hl.text, 6 );
	normal.maxWidth = WIDTH;
	normal.measure();
	normal.x = titlebar.left();
	normal.y = titlebar.bottom() + GAP;
	add( normal );
	
	if (hl.isHighlighted()) {
		normal.mask = hl.inverted();
		
		highlighted = PixelScene.createMultiline( hl.text, 6 );
		highlighted.maxWidth = normal.maxWidth;
		highlighted.measure();
		highlighted.x = normal.x;
		highlighted.y = normal.y;
		add( highlighted );

		highlighted.mask = hl.mask;
		highlighted.hardlight( TITLE_COLOR );
	}
	
	resize( WIDTH, (int)(normal.y + normal.height()) );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:33,代码来源:WndTitledMessage.java

示例13: WndJournal

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public WndJournal() {
	
	super();
	resize( WIDTH, HEIGHT );
	
	txtTitle = PixelScene.createText( TXT_TITLE, 9 );
	txtTitle.hardlight( Window.TITLE_COLOR );
	txtTitle.measure();
	txtTitle.x = PixelScene.align( PixelScene.uiCamera, (WIDTH - txtTitle.width()) / 2 );
	add( txtTitle );
	
	Component content = new Component();
	
	Collections.sort( Journal.records );
	
	float pos = 0;
	for (Journal.Record rec : Journal.records) {
		ListItem item = new ListItem( rec.feature, rec.depth );
		item.setRect( 0, pos, WIDTH, ITEM_HEIGHT );
		content.add( item );
		
		pos += item.height();
	}
	
	content.setSize( WIDTH, pos );
	
	list = new ScrollPane( content );
	add( list );
	
	list.setRect( 0, txtTitle.height(), WIDTH, HEIGHT - txtTitle.height() );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:32,代码来源:WndJournal.java

示例14: WndTitledMessage

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public WndTitledMessage( Component titlebar, String message ) {
	
	super();
	
	int width = PixelDungeon.landscape() ? WIDTH_L : WIDTH_P;
	
	titlebar.setRect( 0, 0, width, 0 );
	add( titlebar );
	
	Highlighter hl = new Highlighter( message );
	
	normal = PixelScene.createMultiline( hl.text, 6 );
	normal.maxWidth = width;
	normal.measure();
	normal.x = titlebar.left();
	normal.y = titlebar.bottom() + GAP;
	add( normal );
	
	if (hl.isHighlighted()) {
		normal.mask = hl.inverted();
		
		highlighted = PixelScene.createMultiline( hl.text, 6 );
		highlighted.maxWidth = normal.maxWidth;
		highlighted.measure();
		highlighted.x = normal.x;
		highlighted.y = normal.y;
		add( highlighted );

		highlighted.mask = hl.mask;
		highlighted.hardlight( TITLE_COLOR );
	}
	
	resize( width, (int)(normal.y + normal.height()) );
}
 
开发者ID:skynet67,项目名称:pixel-dungeon-rebirth,代码行数:35,代码来源:WndTitledMessage.java

示例15: WndKeymap

import com.watabou.noosa.ui.Component; //导入依赖的package包/类
public WndKeymap() {

		int ww = Math.min( 160, PixelScene.uiCamera.width - 16 );
		int wh = PixelScene.uiCamera.height - 24;

		resize( ww, wh );

		RedButton btnReset = new RedButton( "Reset To Defaults" ) {
			@Override
			protected void onClick() {
				resetToDefaults();
				populateList();
			}
		};
		btnReset.setRect( 0, height - BTN_HEIGHT, width, BTN_HEIGHT );
		add( btnReset );

		listContent = new Component();
		final ScrollPane list = new ScrollPane(listContent) {
			@Override
			public void onClick( float x, float y ) {
				for (ListItem item : items.values()) {
					if (item.onClick( x, y )) {
						break;
					}
				}
			}
		};

		populateList();

		add(list);

		list.setRect(0, 0, width, btnReset.top() );
	}
 
开发者ID:skynet67,项目名称:pixel-dungeon-rebirth,代码行数:36,代码来源:WndKeymap.java


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