本文整理汇总了Java中org.lwjgl.input.Mouse.isGrabbed方法的典型用法代码示例。如果您正苦于以下问题:Java Mouse.isGrabbed方法的具体用法?Java Mouse.isGrabbed怎么用?Java Mouse.isGrabbed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.input.Mouse
的用法示例。
在下文中一共展示了Mouse.isGrabbed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMouseMove
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void onMouseMove(MouseMoveEvent e){
if(!Game.win().isFocused()||!Mouse.isGrabbed()) return;
if(noMouseMode){
if(Keyboard.isKeyDown(Keyboard.KEY_Q)) rot.y-=0.1;
if(Keyboard.isKeyDown(Keyboard.KEY_E)) rot.y+=0.1;
if(Keyboard.isKeyDown(Keyboard.KEY_R)) rot.x-=0.1;
if(Keyboard.isKeyDown(Keyboard.KEY_F)) rot.x+=0.1;
}else{
rot.x-=e.yDelta/200F;
rot.y+=e.xDelta/200F;
Game.win().centerMouse();
}
if(rot.x>Math.PI/2) rot.x=(float)(Math.PI/2);
else if(rot.x<-Math.PI/2) rot.x=(float)(-Math.PI/2);
}
示例2: update
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void update(){
if(Mouse.isButtonDown(0) && !Mouse.isGrabbed()) Mouse.setGrabbed(true);
if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && Mouse.isGrabbed()) Mouse.setGrabbed(false);
if(!Mouse.isGrabbed()) return;
world.updateWorld();
//System.out.println("X = "+player.getLocation().getX()+" | Y = "+player.getLocation().getY()+" | Z = "+player.getLocation().getZ()+" | Yaw = "+player.getLocation().getYaw()+" | Pitch = "+(player.getLocation().getPitch()%360));
}
示例3: isMouseGrabbed
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.GameContainer#isMouseGrabbed()
*/
public boolean isMouseGrabbed() {
return Mouse.isGrabbed();
}
示例4: isMouseGrabbed
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.GameContainer#isMouseGrabbed()
*/
public boolean isMouseGrabbed() {
return Mouse.isGrabbed();
}