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


Java Mouse.setGrabbed方法代码示例

本文整理汇总了Java中org.lwjgl.input.Mouse.setGrabbed方法的典型用法代码示例。如果您正苦于以下问题:Java Mouse.setGrabbed方法的具体用法?Java Mouse.setGrabbed怎么用?Java Mouse.setGrabbed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.input.Mouse的用法示例。


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

示例1: onItemRightClick

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand handIn) {
	Mouse.setGrabbed(false); // TODO Remove debug
	ItemStack is = player.getHeldItem(handIn);
	if (player.getHeldItemMainhand().getCount() > 4) {
		if (worldIn.isRemote) {
			GuiKnapping.staticMaterial = CraftMat.CLAY;
			GuiKnapping.staticMaterialSub = this.getSubName(is.getItemDamage());

			player.openGui(FirmaMod.instance, GuiHandler.GUI_KNAPPING, player.world, (int) player.posX, (int) player.posY, (int) player.posZ);
		} else {
			PlayerData pd = PlayerData.getPlayerData(player.getUniqueID());
			pd.resetKnapCraft();
			pd.setItemStack(player.getHeldItemMainhand());
			pd.setCraftingMaterial(CraftMat.CLAY);
		}
	}
	return new ActionResult<ItemStack>(EnumActionResult.PASS, is);
}
 
开发者ID:trigg,项目名称:Firma,代码行数:20,代码来源:ClayItem.java

示例2: onMouseButton

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
	public void onMouseButton(MouseButtonEvent e){
		Gui openGui=guiHandler.getOpenGui();
		if(openGui!=null) openGui.onMouseButton(e);
		else e.source.centerMouse();
		
		if(e.action==Action.DOWN){
			if(Shaders.ENTITY!=null){
				Shaders.ENTITY.load();
				Shaders.TERRAIN.load();
//				Shaders.SKYBOX.load();
//				Shaders.GUI_RECT.load();
//				Shaders.POST_COPY.load();
			}
		}
		
		Mouse.setGrabbed(!Game.isPaused());
	}
 
开发者ID:LapisSea,项目名称:OpenGL-Bullet-engine,代码行数:19,代码来源:Renderer.java

示例3: grabMouseCursor

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Grabs the mouse cursor it doesn't move and isn't seen.
 */
public void grabMouseCursor()
{
    Mouse.setGrabbed(true);
    this.deltaX = 0;
    this.deltaY = 0;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:MouseHelper.java

示例4: closeOpenGui

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public void closeOpenGui(){
	guiStack.pop();
	if(guiStack.isEmpty()){
		Game.win().centerMouse();
		Mouse.setGrabbed(true);
	}
}
 
开发者ID:LapisSea,项目名称:OpenGL-Bullet-engine,代码行数:8,代码来源:GuiHandler.java

示例5: ungrabMouseCursor

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
/**
 * Ungrabs the mouse cursor so it can be moved and set it to the center of the screen
 */
public void ungrabMouseCursor()
{
    // Vanilla Minecraft calls Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2) at this point...
    // but it's seriously annoying, so we don't.
    Mouse.setGrabbed(false);
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:11,代码来源:MalmoModClient.java

示例6: setMouseGrabbed

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * @see org.newdawn.slick.GameContainer#setMouseGrabbed(boolean)
 */
public void setMouseGrabbed(boolean grabbed) {
   Mouse.setGrabbed(grabbed);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:7,代码来源:AppletGameContainer.java

示例7: setMouseGrabbed

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * @see org.newdawn.slick.GameContainer#setMouseGrabbed(boolean)
 */
public void setMouseGrabbed(boolean grabbed) {
	Mouse.setGrabbed(grabbed);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:7,代码来源:AppGameContainer.java

示例8: onFocus

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void onFocus(FocusEvent e){
	if(!e.focused) Mouse.setGrabbed(false);
}
 
开发者ID:LapisSea,项目名称:OpenGL-Bullet-engine,代码行数:5,代码来源:Renderer.java

示例9: openGui

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public void openGui(Gui gui){
	
	if(guiStack.contains(gui)) throw new IllegalStateException();
	guiStack.add(gui);
	Mouse.setGrabbed(false);
}
 
开发者ID:LapisSea,项目名称:OpenGL-Bullet-engine,代码行数:7,代码来源:GuiHandler.java

示例10: ungrabMouseCursor

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Ungrabs the mouse cursor so it can be moved and set it to the center of the screen
 */
public void ungrabMouseCursor()
{
    Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2);
    Mouse.setGrabbed(false);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:MouseHelper.java

示例11: setCursorPosition

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private static final void setCursorPosition(final int x, final int y) {

		Mouse.setGrabbed(true);
		Mouse.setCursorPosition(x, y);
		Mouse.setGrabbed(false);

	}
 
开发者ID:ASasseCreations,项目名称:Voxel_Game,代码行数:8,代码来源:MouseSystem.java


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