mirror of
https://github.com/opus-tango/GravityDev3.git
synced 2026-03-20 03:55:24 +00:00
Initial commit
This commit is contained in:
31
eMouse.pde
Normal file
31
eMouse.pde
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
|
||||
Mouse overrides and functions
|
||||
|
||||
*/
|
||||
|
||||
void mouseDragged() {
|
||||
float mx = pmouseX - mouseX;
|
||||
float my = pmouseY - mouseY;
|
||||
offset.add(mx / scaleMul, my / scaleMul);
|
||||
}
|
||||
|
||||
void mouseWheel(MouseEvent event){
|
||||
float e = event.getCount() * scrollDirection;
|
||||
//offset.sub(mouseX,mouseY);
|
||||
float delta = e < 0 ? 1.05 : e > 0 ? 1.0/1.05 : 1.0;
|
||||
scaleMul *= delta;
|
||||
//offset.add(mouseX,mouseY);
|
||||
}
|
||||
|
||||
void mouseClicked() {
|
||||
boolean guiInteract = gui.clickManager(new Vector(mouseX,mouseY));
|
||||
if(!guiInteract){
|
||||
Vector mouse = mouseS();
|
||||
focus = pm.getCPlanet(mouse.x,mouse.y);
|
||||
}
|
||||
}
|
||||
|
||||
Vector mouseS(){
|
||||
return new Vector((mouseX - width/2) * 1/scaleMul, (mouseY - height/2) * 1/scaleMul);
|
||||
}
|
||||
Reference in New Issue
Block a user