本文整理汇总了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);
}
示例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());
}
示例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;
}
示例4: closeOpenGui
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public void closeOpenGui(){
guiStack.pop();
if(guiStack.isEmpty()){
Game.win().centerMouse();
Mouse.setGrabbed(true);
}
}
示例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);
}
示例6: setMouseGrabbed
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.GameContainer#setMouseGrabbed(boolean)
*/
public void setMouseGrabbed(boolean grabbed) {
Mouse.setGrabbed(grabbed);
}
示例7: setMouseGrabbed
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.GameContainer#setMouseGrabbed(boolean)
*/
public void setMouseGrabbed(boolean grabbed) {
Mouse.setGrabbed(grabbed);
}
示例8: onFocus
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void onFocus(FocusEvent e){
if(!e.focused) Mouse.setGrabbed(false);
}
示例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);
}
示例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);
}
示例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);
}