本文整理汇总了Java中com.jme3.input.event.MouseMotionEvent.setConsumed方法的典型用法代码示例。如果您正苦于以下问题:Java MouseMotionEvent.setConsumed方法的具体用法?Java MouseMotionEvent.setConsumed怎么用?Java MouseMotionEvent.setConsumed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.input.event.MouseMotionEvent
的用法示例。
在下文中一共展示了MouseMotionEvent.setConsumed方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMouseMove
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseMove(MouseMotionEvent evt) {
if (mouseLook) {
if (enabled) {
if (evt.getY() > lastY)
bridge.getChaseCamera().onAnalog("ChaseCamUp", -evt.getDY()*(bridge.getCurrentTPF()/2), bridge.getCurrentTPF());
else
bridge.getChaseCamera().onAnalog("ChaseCamDown", evt.getDY()*(bridge.getCurrentTPF()/2), bridge.getCurrentTPF());
if (evt.getX() > lastX)
bridge.getChaseCamera().onAnalog("ChaseCamMoveRight", evt.getDX()*(bridge.getCurrentTPF()/2), bridge.getCurrentTPF());
else
bridge.getChaseCamera().onAnalog("ChaseCamMoveLeft", -evt.getDX()*(bridge.getCurrentTPF()/2), bridge.getCurrentTPF());
}
lastX = evt.getX();
lastY = evt.getY();
evt.setConsumed();
}
}
示例2: onMouseWheelUp
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheelUp(MouseMotionEvent evt) {
if (getVerticalScrollDistance() > 0) {
scrollYBy(-getTrackInc());
evt.setConsumed();
}
}
示例3: onMouseWheelDown
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheelDown(MouseMotionEvent evt) {
if (getVerticalScrollDistance() > 0) {
scrollYBy(getTrackInc());
evt.setConsumed();
}
}
示例4: onMouseWheelUp
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheelUp(MouseMotionEvent evt) {
if (vScrollBar != null) {
vScrollBar.scrollByYInc(-vScrollBar.getTrackInc());
}
evt.setConsumed();
}
示例5: onMouseWheelDown
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheelDown(MouseMotionEvent evt) {
if (vScrollBar != null) {
vScrollBar.scrollByYInc(vScrollBar.getTrackInc());
}
evt.setConsumed();
}
示例6: onMouseWheelUp
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheelUp(MouseMotionEvent evt) {
if (zoomEnabled) {
if (enabled) {
bridge.getChaseCamera().onAnalog("ChaseCamZoomIn", evt.getDeltaWheel()*(bridge.getCurrentTPF()/4), bridge.getCurrentTPF());
}
}
evt.setConsumed();
}
示例7: onMouseWheelDown
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
@Override
public void onMouseWheelDown(MouseMotionEvent evt) {
if (zoomEnabled) {
if (enabled) {
bridge.getChaseCamera().onAnalog("ChaseCamZoomIn", evt.getDeltaWheel()*(bridge.getCurrentTPF()/4), bridge.getCurrentTPF());
}
}
evt.setConsumed();
}
示例8: onMouseMotionEvent
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
public void onMouseMotionEvent(MouseMotionEvent oldEvt, MouseMotionEvent evt) {
setMouseXY(evt.getX(),evt.getY());
if (!mousePressed) {
mouseFocusElement = getEventElement(evt.getX(), evt.getY());
if (mouseFocusElement != previousMouseFocusElement) {
if (previousMouseFocusElement instanceof MouseFocusListener) {
((MouseFocusListener)previousMouseFocusElement).onLoseFocus(evt);
}
if (mouseFocusElement instanceof MouseFocusListener) {
((MouseFocusListener)mouseFocusElement).onGetFocus(evt);
}
previousMouseFocusElement = mouseFocusElement;
}
if (mouseFocusElement != null) {
focusElementIsMovable = mouseFocusElement.getIsMovable();
if (mouseFocusElement instanceof MouseWheelListener) {
if (evt.getDeltaWheel() > 0) {
((MouseWheelListener)mouseFocusElement).onMouseWheelDown(evt);
} else if (evt.getDeltaWheel() < 0) {
((MouseWheelListener)mouseFocusElement).onMouseWheelUp(evt);
}
oldEvt.setConsumed();
}
}
if (mouseFocusElement instanceof MouseMovementListener) {
((MouseMovementListener)mouseFocusElement).onMouseMove(evt);
}
} else {
if (eventElement != null) {
if (mouseLeftPressed) {
focusElementIsMovable = contactElement.getIsMovable();
if (eventElementResizeDirection != null) {
eventElement.resize(evt.getX(), evt.getY(), eventElementResizeDirection);
} else if (focusElementIsMovable) {
eventElement.moveTo(evt.getX()-eventElementOffsetX, evt.getY()-eventElementOffsetY);
}
}
if (eventElement instanceof MouseMovementListener) {
((MouseMovementListener)eventElement).onMouseMove(evt);
}
}
}
}