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


Java Touch类代码示例

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


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

示例1: onTouchDown

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onTouchDown(Touch t) {

	if (t != touch && another == null) {

		if (!touch.down) {
			touch = t;
			onTouchDown(t);
			return;
		}

		pinching = true;

		another = t;
		startSpan = PointF.distance(touch.current, another.current);
		startZoom = camera.zoom;

		dragging = false;
	} else if (t != touch) {
		reset();
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:23,代码来源:CellSelector.java

示例2: onTouchUp

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onTouchUp(Touch t) {
	if (pinching && (t == touch || t == another)) {

		pinching = false;

		int zoom = Math.round(camera.zoom);
		camera.zoom(zoom);
		ShatteredPixelDungeon.zoom(zoom - PixelScene.defaultZoom);

		dragging = true;
		if (t == touch) {
			touch = another;
		}
		another = null;
		lastPos.set(touch.current);
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:19,代码来源:CellSelector.java

示例3: WndStory

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
public WndStory(String text) {
	super(0, 0, Chrome.get(Chrome.Type.SCROLL));

	tf = PixelScene.renderMultiline(text, 7);
	tf.maxWidth(ShatteredPixelDungeon.landscape() ?
			WIDTH_L - MARGIN * 2 :
			WIDTH_P - MARGIN * 2);
	tf.invert();
	tf.setPos(MARGIN, 0);
	add(tf);

	add(new TouchArea(chrome) {
		@Override
		protected void onClick(Touch touch) {
			hide();
		}
	});

	resize((int) (tf.width() + MARGIN * 2),
			(int) Math.min(tf.height(), 180));
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:22,代码来源:WndStory.java

示例4: onTouchDown

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onTouchDown( Touch t ) {

	if (t != touch && another == null) {
				
		if (!touch.down) {
			touch = t;
			onTouchDown( t );
			return;
		}
		
		pinching = true;
		
		another = t;
		startSpan = PointF.distance( touch.current, another.current );
		startZoom = camera.zoom;

		dragging = false;
	} else if (t != touch) {
		reset();
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:23,代码来源:CellSelector.java

示例5: onTouchUp

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onTouchUp( Touch t ) {
	if (pinching && (t == touch || t == another)) {
		
		pinching = false;
		
		zoom(Math.round( camera.zoom ));
		
		dragging = true;
		if (t == touch) {
			touch = another;
		}
		another = null;
		lastPos.set( touch.current );
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:17,代码来源:CellSelector.java

示例6: WndStory

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
public WndStory( String text ) {
	super( 0, 0, Chrome.get( Chrome.Type.SCROLL ) );
	
	tf = PixelScene.renderMultiline( text, 7 );
	tf.maxWidth(UNISTPixelDungeon.landscape() ?
				WIDTH_L - MARGIN * 2:
				WIDTH_P - MARGIN *2);
	tf.invert();
	tf.setPos(MARGIN, 0);
	add( tf );
	
	add( new TouchArea( chrome ) {
		@Override
		protected void onClick( Touch touch ) {
			hide();
		}
	} );
	
	resize( (int)(tf.width() + MARGIN * 2), (int)Math.min( tf.height(), 180 ) );
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:21,代码来源:WndStory.java

示例7: onTouchDown

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onTouchDown( Touch t ) {

	if (t != touch && another == null) {
				
		if (!touch.down) {
			touch = t;
			onTouchDown( t );
			return;
		}
		
		pinching = true;
		
		another = t;
		startSpan = PointF.distance( touch.current, another.current );
		startZoom = camera.zoom;

		dragging = false;
	}
}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:21,代码来源:CellSelector.java

示例8: onTouchUp

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onTouchUp( Touch t ) {
	if (pinching && (t == touch || t == another)) {

		pinching = false;
		
		int zoom = Math.round( camera.zoom );
		camera.zoom( zoom );
		YetAnotherPixelDungeon.zoom((int) (zoom - PixelScene.defaultZoom));

		dragging = true;
		if (t == touch) {
			touch = another;
		}
		another = null;
		lastPos.set( touch.current );
	}
}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:19,代码来源:CellSelector.java

示例9: WndStory

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
public WndStory( String text ) {
	super( 0, 0, Chrome.get( Chrome.Type.SCROLL ) );
	
	tf = PixelScene.createMultiline( text, 7 );
	tf.maxWidth = WIDTH - MARGIN * 2;
	tf.measure();
	tf.ra = bgR;
	tf.ga = bgG;
	tf.ba = bgB;
	tf.rm = -bgR;
	tf.gm = -bgG;
	tf.bm = -bgB;
	tf.x = MARGIN;
	add( tf );
	
	add( new TouchArea( chrome ) {
		@Override
		protected void onClick( Touch touch ) {
			hide();
		}
	} );
	
	resize( (int)(tf.width() + MARGIN * 2), (int)Math.min( tf.height(), 180 ) );
}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:25,代码来源:WndStory.java

示例10: onTouchUp

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onTouchUp( Touch t ) {
	if (pinching && (t == touch || t == another)) {
		
		pinching = false;
		
		int zoom = Math.round( camera.zoom );
		camera.zoom( zoom );
		ShatteredPixelDungeon.zoom((int) (zoom - PixelScene.defaultZoom));
		
		dragging = true;
		if (t == touch) {
			touch = another;
		}
		another = null;
		lastPos.set( touch.current );
	}
}
 
开发者ID:FthrNature,项目名称:unleashed-pixel-dungeon,代码行数:19,代码来源:CellSelector.java

示例11: WndStory

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
public WndStory( String text ) {
	super( 0, 0, Chrome.get( Chrome.Type.SCROLL ) );
	
	tf = PixelScene.createMultiline( text, 7 );
	tf.maxWidth = ShatteredPixelDungeon.landscape() ?
				WIDTH_L - MARGIN * 2:
				WIDTH_P - MARGIN *2;
	tf.measure();
	tf.ra = bgR;
	tf.ga = bgG;
	tf.ba = bgB;
	tf.rm = -bgR;
	tf.gm = -bgG;
	tf.bm = -bgB;
	tf.x = MARGIN;
	add( tf );
	
	add( new TouchArea( chrome ) {
		@Override
		protected void onClick( Touch touch ) {
			hide();
		}
	} );
	
	resize( (int)(tf.width() + MARGIN * 2), (int)Math.min( tf.height(), 180 ) );
}
 
开发者ID:FthrNature,项目名称:unleashed-pixel-dungeon,代码行数:27,代码来源:WndStory.java

示例12: onTouchUp

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onTouchUp( Touch t ) {
	if (pinching && (t == touch || t == another)) {

		pinching = false;
		
		int zoom = Math.round( camera.zoom );
		camera.zoom( zoom );
		PixelDungeon.zoom( (int)(zoom - PixelScene.defaultZoom) );

		dragging = true;
		if (t == touch) {
			touch = another;
		}
		another = null;
		lastPos.set( touch.current );
	}
}
 
开发者ID:HalcyonFish,项目名称:OHSCompSciClubPixelDungeon,代码行数:19,代码来源:CellSelector.java

示例13: WndStory

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
public WndStory( String text ) {
	super( 0, 0, Chrome.get( Chrome.Type.SCROLL ) );
	
	tf = PixelScene.renderMultiline( text, 6 );
	tf.maxWidth(ShatteredPixelDungeon.landscape() ?
				WIDTH_L - MARGIN * 2:
				WIDTH_P - MARGIN *2);
	tf.invert();
	tf.setPos(MARGIN, 0);
	add( tf );
	
	add( new TouchArea( chrome ) {
		@Override
		protected void onClick( Touch touch ) {
			hide();
		}
	} );
	
	resize( (int)(tf.width() + MARGIN * 2), (int)Math.min( tf.height(), 180 ) );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:21,代码来源:WndStory.java

示例14: onTouchUp

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onTouchUp( Touch t ) {
	if (pinching && (t == touch || t == another)) {
		
		pinching = false;
		
		int zoom = Math.round( camera.zoom );
		camera.zoom( zoom );
		PixelDungeon.zoom(zoom - PixelScene.defaultZoom);

		dragging = true;
		if (t == touch) {
			touch = another;
		}
		another = null;
		lastPos.set( touch.current );
	}
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:19,代码来源:CellSelector.java

示例15: createTouchEmail

import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
private Text createTouchEmail(final String address, Text text2)
{
	Text text = createText(address, text2);
	text.hardlight( Window.TITLE_COLOR );
	
	TouchArea area = new TouchArea( text ) {
		@Override
		protected void onClick( Touch touch ) {
			Intent intent = new Intent( Intent.ACTION_SEND);
			intent.setType("message/rfc822");
			intent.putExtra(Intent.EXTRA_EMAIL, new String[]{address} );
			intent.putExtra(Intent.EXTRA_SUBJECT, Game.getVar(R.string.app_name) );

			Game.instance().startActivity( Intent.createChooser(intent, SND) );
		}
	};
	add(area);
	return text;
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:20,代码来源:AboutScene.java


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