Skip to content
Permalink
Browse files

木琴を動かす、スケーリングをする実装を追加

  • Loading branch information
takk
takk committed Mar 16, 2019
1 parent 8a6dd12 commit e5cfd80823573ac13ddf34317ed040e265aaac56
Showing with 6 additions and 2 deletions.
  1. +6 −2 MathKitJavaFX/src/zenryokuservice/fx/tutorial/download/Xylophone.java
@@ -248,7 +248,7 @@
rectangleGroup.setScaleX(2.5);
rectangleGroup.setScaleY(2.5);
rectangleGroup.setScaleZ(2.5);
//cam.getChildren().add(rectangleGroup);
cam.getChildren().add(rectangleGroup);

frameCam(stage, scene);

@@ -299,7 +299,11 @@ else if (me.isAltDown() && me.isMiddleButtonDown()) {
double ty = cam.t.getY();
cam.t.setX(tx + mouseDeltaX);
cam.t.setY(ty + mouseDeltaY);
}
} else if (me.isAltDown() && me.isSecondaryButtonDown()) {
double scale = cam.s.getX();
double newScale = scale + mouseDeltaX*0.01;
cam.s.setX(newScale); cam.s.setY(newScale); cam.s.setZ(newScale);
}
}
});
scene.setOnKeyPressed(new EventHandler<KeyEvent>() {

0 comments on commit e5cfd80

Please sign in to comment.
You can’t perform that action at this time.