本文整理汇总了Java中com.watabou.input.Touchscreen.Touch类的典型用法代码示例。如果您正苦于以下问题:Java Touch类的具体用法?Java Touch怎么用?Java Touch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Touch类属于com.watabou.input.Touchscreen包,在下文中一共展示了Touch类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: createTouchLink
import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
private Text createTouchLink(final String address, Text visit)
{
Text text = createText(address, visit);
text.hardlight( Window.TITLE_COLOR );
TouchArea area = new TouchArea( text ) {
@Override
protected void onClick( Touch touch ) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(address));
Game.instance().startActivity( Intent.createChooser(intent, OUR_SITE) );
}
};
add(area);
return text;
}
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:17,代码来源:AboutScene.java
示例17: onClick
import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onClick(Touch touch) {
if (dragging) {
dragging = false;
} else {
select(((DungeonTilemap) target).screenToTile(
(int) touch.current.x, (int) touch.current.y));
}
}
开发者ID:G2159687,项目名称:ESPD,代码行数:13,代码来源:CellSelector.java
示例18: onDrag
import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onDrag(Touch t) {
camera.target = null;
if (pinching) {
float curSpan = PointF.distance(touch.current, another.current);
camera.zoom(GameMath.gate(PixelScene.minZoom, startZoom * curSpan
/ startSpan, PixelScene.maxZoom));
} else {
if (!dragging
&& PointF.distance(t.current, t.start) > dragThreshold) {
dragging = true;
lastPos.set(t.current);
} else if (dragging) {
camera.scroll.offset(PointF.diff(lastPos, t.current).invScale(
camera.zoom));
lastPos.set(t.current);
}
}
}
开发者ID:G2159687,项目名称:ESPD,代码行数:28,代码来源:CellSelector.java
示例19: onClick
import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onClick(Touch touch) {
if (dragging) {
dragging = false;
} else {
PointF p = content.camera.screenToCamera((int) touch.current.x,
(int) touch.current.y);
ScrollPane.this.onClick(p.x, p.y);
}
}
开发者ID:G2159687,项目名称:ESPD,代码行数:15,代码来源:ScrollPane.java
示例20: onDrag
import com.watabou.input.Touchscreen.Touch; //导入依赖的package包/类
@Override
protected void onDrag(Touch t) {
if (dragging) {
Camera c = content.camera;
c.scroll.offset(PointF.diff(lastPos, t.current)
.invScale(c.zoom));
if (c.scroll.x + width > content.width()) {
c.scroll.x = content.width() - width;
}
if (c.scroll.x < 0) {
c.scroll.x = 0;
}
if (c.scroll.y + height > content.height()) {
c.scroll.y = content.height() - height;
}
if (c.scroll.y < 0) {
c.scroll.y = 0;
}
lastPos.set(t.current);
} else if (PointF.distance(t.current, t.start) > dragThreshold) {
dragging = true;
lastPos.set(t.current);
}
}
开发者ID:G2159687,项目名称:ESPD,代码行数:31,代码来源:ScrollPane.java
注:本文中的com.watabou.input.Touchscreen.Touch类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论