當前位置: 首頁>>代碼示例>>Java>>正文


Java NoosaInputProcessor類代碼示例

本文整理匯總了Java中com.watabou.input.NoosaInputProcessor的典型用法代碼示例。如果您正苦於以下問題:Java NoosaInputProcessor類的具體用法?Java NoosaInputProcessor怎麽用?Java NoosaInputProcessor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NoosaInputProcessor類屬於com.watabou.input包,在下文中一共展示了NoosaInputProcessor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: create

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
public void create() {
	Gdx.input.setCatchBackKey(true);
	Game.instance.getInputProcessor().addKeyListener(keyListener = new Signal.Listener<NoosaInputProcessor.Key>() {
		@Override
		public void onSignal(NoosaInputProcessor.Key key) {
			if (Game.instance != null && key.pressed) {
				switch (key.code) {
					case Input.Keys.BACK:
					case Input.Keys.ESCAPE:
						onBackPressed();
						break;
					case Input.Keys.MENU:
					case Input.Keys.F5:
						onMenuPressed();
						break;
				}
			}
		}
	});
}
 
開發者ID:kurtyu,項目名稱:PixelDungeonTC,代碼行數:21,代碼來源:Scene.java

示例2: onTouchDown

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
@Override
protected void onTouchDown( NoosaInputProcessor.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:kurtyu,項目名稱:PixelDungeonTC,代碼行數:21,代碼來源:CellSelector.java

示例3: onTouchUp

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
@Override
protected void onTouchUp( NoosaInputProcessor.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:kurtyu,項目名稱:PixelDungeonTC,代碼行數:19,代碼來源:CellSelector.java

示例4: WndStory

import com.watabou.input.NoosaInputProcessor; //導入依賴的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( NoosaInputProcessor.Touch touch ) {
			hide();
		}
	} );
	
	resize( (int)(tf.width() + MARGIN * 2), (int)Math.min( tf.height(), 180 ) );
}
 
開發者ID:kurtyu,項目名稱:PixelDungeonTC,代碼行數:25,代碼來源:WndStory.java

示例5: onSignal

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
@Override
public void onSignal( NoosaInputProcessor.Key<GameAction> key ) {
	if (key.pressed) {
		switch (key.code) {
		case Input.Keys.BACK:
			onBackPressed();			
			break;
		case Input.Keys.MENU:
			onMenuPressed();			
			break;
		}
	}


	Game.instance.getInputProcessor().cancelKeyEvent();
}
 
開發者ID:kurtyu,項目名稱:PixelDungeonTC,代碼行數:17,代碼來源:Window.java

示例6: create

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
public void create() {
    Game.instance.getInputProcessor().addKeyListener(keyListener = new Signal.Listener<NoosaInputProcessor.Key>() {
        @Override
        public void onSignal(NoosaInputProcessor.Key key) {
            if (Game.instance != null && key.pressed) {
                switch (key.code) {
                    case Input.Keys.BACK:
                    case Input.Keys.ESCAPE:
                        onBackPressed();
                        break;
                    case Input.Keys.MENU:
                    case Input.Keys.F5:
                        onMenuPressed();
                        break;
                }
            }
        }
    });
}
 
開發者ID:skynet67,項目名稱:pixel-dungeon-rebirth,代碼行數:20,代碼來源:Scene.java

示例7: onSignal

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
@Override
public void onSignal(NoosaInputProcessor.Key<GameAction> key) {
    if (key.pressed) {
        switch (key.code) {
            case Input.Keys.BACK:
            case Input.Keys.ESCAPE:
                onBackPressed();
                break;
            case Input.Keys.MENU:
                onMenuPressed();
                break;
            default:
                onKeyDown(key);
                break;
        }
    } else {
        onKeyUp(key);
    }

    Game.instance.getInputProcessor().cancelKeyEvent();
}
 
開發者ID:skynet67,項目名稱:pixel-dungeon-rebirth,代碼行數:22,代碼來源:Window.java

示例8: create

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
public void create() {
	Game.instance.getInputProcessor().addKeyListener(keyListener = new Signal.Listener<NoosaInputProcessor.Key>() {
		@Override
		public void onSignal(NoosaInputProcessor.Key key) {
			if (Game.instance != null && key.pressed) {
				switch (key.code) {
					case Input.Keys.BACK:
					case Input.Keys.ESCAPE:
						onBackPressed();
						break;
					case Input.Keys.MENU:
					case Input.Keys.F5:
						onMenuPressed();
						break;
				}
			}
		}
	});
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon-gdx,代碼行數:20,代碼來源:Scene.java

示例9: onTouchDown

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
@Override
protected void onTouchDown( NoosaInputProcessor.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:00-Evan,項目名稱:shattered-pixel-dungeon-gdx,代碼行數:23,代碼來源:CellSelector.java

示例10: onTouchUp

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
@Override
protected void onTouchUp( NoosaInputProcessor.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:00-Evan,項目名稱:shattered-pixel-dungeon-gdx,代碼行數:17,代碼來源:CellSelector.java

示例11: WndStory

import com.watabou.input.NoosaInputProcessor; //導入依賴的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( NoosaInputProcessor.Touch touch ) {
			hide();
		}
	} );
	
	resize( (int)(tf.width() + MARGIN * 2), (int)Math.min( tf.height(), 180 ) );
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon-gdx,代碼行數:21,代碼來源:WndStory.java

示例12: onClick

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
@Override
protected void onClick() {
	if (!lastBag.contains(item) && !item.isEquipped(Dungeon.hero)){

		hide();

	} else if (listener != null) {
		
		hide();
		listener.onSelect( item );
		
	} else {

		if (NoosaInputProcessor.modifier) {
			onLongClick();
		} else {
			GameScene.show(new WndItem( WndBag.this, item ) );
		}
		
	}
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon-gdx,代碼行數:22,代碼來源:WndBag.java

示例13: createChildren

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
@Override
protected void createChildren() {
	panel = Chrome.get(Chrome.Type.TOAST_TR);
	add( panel );

	//updateMessage = new BitmapText("Checking Updates", PixelScene.font1x);
	updateMessage = PixelScene.createText("Checking Updates", 9);
	add(updateMessage);

	touchUpdate = new TouchArea( panel ){
		@Override
		protected void onClick( NoosaInputProcessor.Touch touch ) {
			if (updateAvailable) {
				parent.add(new WndUpdate() );
				Sample.INSTANCE.play( Assets.SND_CLICK );
			}
		}
	};
	add(touchUpdate);

	updateMessage();
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon-gdx,代碼行數:23,代碼來源:UpdateNotification.java

示例14: onSignal

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
@Override
public void onSignal( NoosaInputProcessor.Key<GameAction> key ) {
	if (key.pressed) {
		switch (key.code) {
		case Input.Keys.BACK:
		case Input.Keys.ESCAPE:
			onBackPressed();
			break;
		case Input.Keys.MENU:
			onMenuPressed();
			break;
		default:
			onKeyDown(key);
			break;
		}
	} else {
		onKeyUp( key );
	}

	Game.instance.getInputProcessor().cancelKeyEvent();
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon-gdx,代碼行數:22,代碼來源:Window.java

示例15: createChildren

import com.watabou.input.NoosaInputProcessor; //導入依賴的package包/類
@Override
protected void createChildren() {
	hotArea = new TouchArea<T>( 0, 0, 0, 0 ) {
		@Override
		protected void onTouchDown(NoosaInputProcessor.Touch touch) {
			pressed = true;
			pressTime = 0;
			processed = false;
			Button.this.onTouchDown();
		};
		@Override
		protected void onTouchUp(NoosaInputProcessor.Touch touch) {
			pressed = false;
			Button.this.onTouchUp();
		};
		@Override
		protected void onClick( NoosaInputProcessor.Touch touch ) {
			if (!processed) {
				if (NoosaInputProcessor.modifier && onLongClick()) {
				// Do nothing
				} else {
					Button.this.onClick();
				}
			}
		};
		@Override
		public boolean onKeyDown(NoosaInputProcessor.Key<T> key) {
			return Button.this.onKeyDown(key);
		}
		@Override
		public boolean onKeyUp(NoosaInputProcessor.Key<T> key) {
			return Button.this.onKeyUp(key);
		}
	};
	add( hotArea );
}
 
開發者ID:kurtyu,項目名稱:PixelDungeonTC,代碼行數:37,代碼來源:Button.java


注:本文中的com.watabou.input.NoosaInputProcessor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。