Skip to content

Commit

Permalink
collectable and flag mode
Browse files Browse the repository at this point in the history
  • Loading branch information
alikmr committed Jun 26, 2019
1 parent 9510168 commit bcd7e51
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/View/Viewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -919,13 +919,10 @@ public void graphicShowItem(){
try {
Image image;
image = new Image(new FileInputStream("img/collectable.png"));
System.out.println(i + " " + j);
// System.out.println(i + " " + j);
ImageView imageView = new ImageView(image);
// imageView.setX(195 + 70 * i);
// imageView.setY(160 + 70 *j);

imageView.setFitHeight(60);
imageView.relocate(202 + 72*j + 70.0/2.0 - imageView.getLayoutBounds().getWidth()/2 - 2*7 ,170 + 2*72 + 55.0/2.0 - imageView.getLayoutBounds().getHeight()/2);
imageView.relocate(320 + 72*j + 70.0/2.0 - imageView.getLayoutBounds().getWidth()/2 - 2*7 ,170 + i*72 + 55.0/2.0 - imageView.getLayoutBounds().getHeight()/2);

imageView.setPreserveRatio(true);
group.getChildren().add(imageView);
Expand All @@ -938,14 +935,10 @@ else if(items.get(k).isFlag()){
try {
Image image;
image = new Image(new FileInputStream("img/flag.png"));
System.out.println(i + " " + j);
// System.out.println(i + " " + j);
ImageView imageView = new ImageView(image);
// imageView.setX(195 + 70 * i);
// imageView.setY(160 + 70 *j);

imageView.relocate(440 + 72*j + 70.0/2.0 - imageView.getLayoutBounds().getWidth()/2 - 2*7 ,430 + i*72 + 55.0/2.0 - imageView.getLayoutBounds().getHeight()/2);
imageView.setFitHeight(40);
imageView.relocate(202 + 72*j + 70.0/2.0 - imageView.getLayoutBounds().getWidth()/2 - 2*7 ,170 + 2*72 + 55.0/2.0 - imageView.getLayoutBounds().getHeight()/2);

imageView.setPreserveRatio(true);
group.getChildren().add(imageView);
}
Expand Down

0 comments on commit bcd7e51

Please sign in to comment.