Pushed missing files

Started adding Replay Editor using johni0702's excellent ReplayStudio Library
Added fully functional GuiDropdown GUI Element (useable in other projects as well)
This commit is contained in:
Marius Metzger
2015-03-10 00:34:26 +01:00
parent b4ce266375
commit 9b69681ef0
21 changed files with 383 additions and 128 deletions

View File

@@ -0,0 +1,32 @@
package eu.crushedpixel.replaymod.utils;
import java.awt.Point;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import org.lwjgl.input.Mouse;
public class MouseUtils {
private static final Minecraft mc = Minecraft.getMinecraft();
public static Point getMousePos() {
Point scaled = getScaledDimensions();
int width = (int)scaled.getX();
int height = (int)scaled.getY();
final int mouseX = (Mouse.getX() * width / mc.displayWidth);
final int mouseY = (height - Mouse.getY() * height / mc.displayHeight);
return new Point(mouseX, mouseY);
}
public static Point getScaledDimensions() {
ScaledResolution sr = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
final int width = sr.getScaledWidth();
final int heigth = sr.getScaledHeight();
return new Point(width, heigth);
}
}