本文整理汇总了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();
}
}
示例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);
}
}
示例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));
}
示例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();
}
}
示例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 );
}
}
示例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 ) );
}
示例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;
}
}
示例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 );
}
}
示例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 ) );
}
示例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 );
}
}
示例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 ) );
}
示例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 );
}
}
示例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 ) );
}
示例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 );
}
}
示例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;
}