use of com.mojang.blaze3d.platform.Window in project MinecraftForge by MinecraftForge.
the class ForgeHooksClient method onScreenMouseScrollPre.
public static boolean onScreenMouseScrollPre(MouseHandler mouseHelper, Screen guiScreen, double scrollDelta) {
Window mainWindow = guiScreen.getMinecraft().getWindow();
double mouseX = mouseHelper.xpos() * (double) mainWindow.getGuiScaledWidth() / (double) mainWindow.getScreenWidth();
double mouseY = mouseHelper.ypos() * (double) mainWindow.getGuiScaledHeight() / (double) mainWindow.getScreenHeight();
Event event = new ScreenEvent.MouseScrollEvent.Pre(guiScreen, mouseX, mouseY, scrollDelta);
return MinecraftForge.EVENT_BUS.post(event);
}
use of com.mojang.blaze3d.platform.Window in project MinecraftForge by MinecraftForge.
the class ForgeHooksClient method onScreenMouseScrollPost.
public static boolean onScreenMouseScrollPost(MouseHandler mouseHelper, Screen guiScreen, double scrollDelta) {
Window mainWindow = guiScreen.getMinecraft().getWindow();
double mouseX = mouseHelper.xpos() * (double) mainWindow.getGuiScaledWidth() / (double) mainWindow.getScreenWidth();
double mouseY = mouseHelper.ypos() * (double) mainWindow.getGuiScaledHeight() / (double) mainWindow.getScreenHeight();
Event event = new ScreenEvent.MouseScrollEvent.Post(guiScreen, mouseX, mouseY, scrollDelta);
return MinecraftForge.EVENT_BUS.post(event);
}
Aggregations