Search in sources :

Example 1 with MouseAxis

use of org.terasology.engine.input.events.MouseAxisEvent.MouseAxis in project Terasology by MovingBlocks.

the class LocalPlayerSystem method onMouseMove.

@ReceiveEvent(components = CharacterComponent.class)
public void onMouseMove(MouseAxisEvent event, EntityRef entity) {
    MouseAxis axis = event.getMouseAxis();
    if (axis == MouseAxis.X) {
        lookYawDelta = event.getValue();
    } else if (axis == MouseAxis.Y) {
        lookPitchDelta = event.getValue();
    }
    event.consume();
}
Also used : MouseAxis(org.terasology.engine.input.events.MouseAxisEvent.MouseAxis) ReceiveEvent(org.terasology.engine.entitySystem.event.ReceiveEvent)

Aggregations

ReceiveEvent (org.terasology.engine.entitySystem.event.ReceiveEvent)1 MouseAxis (org.terasology.engine.input.events.MouseAxisEvent.MouseAxis)1