use of org.terasology.nui.events.NUIMouseWheelEvent in project Terasology by MovingBlocks.
the class NUIManagerInternal method mouseWheelEvent.
// mouse wheel events
@ReceiveEvent(components = ClientComponent.class, priority = EventPriority.PRIORITY_HIGH)
public void mouseWheelEvent(MouseWheelEvent event, EntityRef entity) {
if (!mouse.isVisible()) {
return;
}
Vector2i mousePosition = event.getMousePosition();
if (focus != null) {
NUIMouseWheelEvent nuiEvent = new NUIMouseWheelEvent(mouse, keyboard, mousePosition, event.getWheelTurns());
focus.onMouseWheelEvent(nuiEvent);
if (nuiEvent.isConsumed()) {
event.consume();
return;
}
}
if (canvas.processMouseWheel(event.getWheelTurns(), mousePosition)) {
event.consume();
}
if (isReleasingMouse()) {
event.consume();
}
}
Aggregations