本文整理汇总了Java中com.jme3.input.event.MouseMotionEvent.getDeltaWheel方法的典型用法代码示例。如果您正苦于以下问题:Java MouseMotionEvent.getDeltaWheel方法的具体用法?Java MouseMotionEvent.getDeltaWheel怎么用?Java MouseMotionEvent.getDeltaWheel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.input.event.MouseMotionEvent
的用法示例。
在下文中一共展示了MouseMotionEvent.getDeltaWheel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMouseMotionEvent
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
public void onMouseMotionEvent(MouseMotionEvent evt) {
// Only forward the event if there's actual motion involved.
// No longer ignores mouse wheel
if (inputManager.isCursorVisible() && (evt.getDX() != 0 ||
evt.getDY() != 0 ||
evt.getDeltaWheel() != 0)){
inputQueue.add(evt);
}
}
示例2: s3dOnMouseMotionEvent
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
private void s3dOnMouseMotionEvent(MouseMotionEvent evt, boolean guiFocus) {
if (!mousePressed) {
float x = Screen.isAndroid() ? touchXY.x : mouseXY.x;
float y = Screen.isAndroid() ? touchXY.y : mouseXY.y;
mouseFocusNode = getEventNode(x, y);
if (!guiFocus) {
if (mouseFocusNode != previousMouseFocusNode) {
if (previousMouseFocusNode instanceof MouseFocusListener) {
((MouseFocusListener)previousMouseFocusNode).onLoseFocus(evt);
}
if (mouseFocusNode instanceof MouseFocusListener) {
((MouseFocusListener)mouseFocusNode).onGetFocus(evt);
}
previousMouseFocusNode = mouseFocusNode;
}
if (mouseFocusNode != null) {
if (mouseFocusNode instanceof MouseWheelListener) {
if (evt.getDeltaWheel() > 0) {
((MouseWheelListener)mouseFocusNode).onMouseWheelDown(evt);
} else if (evt.getDeltaWheel() < 0) {
((MouseWheelListener)mouseFocusNode).onMouseWheelUp(evt);
}
}
}
if (mouseFocusNode instanceof MouseMovementListener) {
((MouseMovementListener)mouseFocusNode).onMouseMove(evt);
}
} else {
if (previousMouseFocusNode instanceof MouseFocusListener) {
((MouseFocusListener)previousMouseFocusNode).onLoseFocus(evt);
previousMouseFocusNode = null;
}
}
}
}
示例3: onMouseMotionEvent
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
public void onMouseMotionEvent(MouseMotionEvent evt) {
// Only forward the event if there's actual motion involved.
if (inputManager.isCursorVisible() && (evt.getDX() != 0 ||
evt.getDY() != 0 ||
evt.getDeltaWheel() != 0)){
inputQueue.add(evt);
}
}
示例4: MouseUIWheelEvent
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
public MouseUIWheelEvent(MouseMotionEvent originator, E element, int modifiers) {
super(originator, element, modifiers);
direction = originator.getDeltaWheel() < 0 ? Direction.up : Direction.down;
}
示例5: MouseUIMotionEvent
import com.jme3.input.event.MouseMotionEvent; //导入方法依赖的package包/类
public MouseUIMotionEvent(MouseMotionEvent originator, int relx, int rely, E element, int modifiers) {
this(originator.getX(), originator.getY(), originator.getDX(), originator.getDY(), originator.getWheel(),
originator.getDeltaWheel(), relx, rely, modifiers, element);
this.originator = originator;
}
示例6: 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);
}
}
}
}